How to Install Rails on a Mac
Walk through the different options for installing the Ruby on Rails framework on a Mac computer.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

In this tutorial, I'm going to show you how to install Rails on a Mac. Just like how we installed on a PC, I'm going to show you three different ways to do it.

InstallRails.com

In the first option, go to InstallRails.com and follow the step-by-step instructions given there. To start with, it's going to ask you which operating system you're using, and in the next screen, you'll have to give the Mac OS version. The rest is pretty self-explanatory. Though it may feel cumbersome, its important you follow all the instructions to avoid problems later on.

I've gone through many sites and I think this is the most comprehensive one. In fact, the instructions on this site are specific to the version you have, and this is a huge plus.

RailsInstaller.org

An easier choice would be to install from Railsinstaller.org. When you go to this site, you will have an option to install Rails for different Mac versions. Just click the download button, and the installation will happen automatically. The only downside is that it currently has Rails only for Mac versions 10.6,10.7 and 10.8. so if you have a higher version, then this option won't work for you.

Nitrous.io

The third option is to use nitrous.io, just like how we did it for the PC. For those of you who didn't watch that video, Nitrous is a cloud-based code editor that allows you to access the Rails development environment online. It takes care of all the complex work, and all that you have to do is create an account, choose the right plan and start working. There is a free and a paid plan, and I would recommend the latter if you plan to create many Rails applications. It's a great tool if you don't want to install Rails directly on your system or if you want to have a development environment across different computers.

Database

One aspect I'd like to tell you at this point is regarding the database. By default, Rails comes with a SQLite database, but this is too lightweight and does not have many of the features needed for a production database. This is why I recommend PostgreSQL.

To install it, go to postgresapp and click on download. Once you do this, you will have an executable application that you can run it on your computer. If you have any issue with downloading or installing, go to brew.sh and install Homebrew. This app manages packages including postgres on your computer.

After installing Homebrew, and follow these instructions to install postgres.

Multiple Versions of Ruby

During development you may want to use different versions of Ruby for different applications. To know the different versions installed on your computer, go to the terminal and type rvm list, and this will bring up a list of Ruby versions.

To install RVM, go to rvm.io/rvm/install. This page also has detailed instructions on how to install RVM. This is not really needed to learn Ruby on Rails, but then you will only be able to use the default version of Ruby that may not work for legacy applications. So, I recommend installing RVM before you begin to work on your projects.

With this, you're all set to build your first Ruby on Rails application.