In Chapter 2 of Beginning Rails I cover installation of the Rails stack in detail. Perhaps my least favorite part of the installation instructions are those for OS X.
If you’re on windows, you have the famous one-click installer. If you’re on Linux, your package manager will do all the heavy lifting. But if you’re on OS X, the process is a little more involved. Google is more than happy to uncover a multitude of different ways to install Ruby on OS X, none of which are particularly easy for the beginner.
In the book, I resorted to a complete walk-through of installing the Apple developer tools and compiling each component from scratch. This can be a daunting task for the beginner, and though I think I did a pretty good job of breaking down the process, it’s far from painless.
From the book:
You would think that given the prevalence of OS X among Rails developers (the entire core team uses OS X) that installing it would be easy. Alas, it’s not. Due to the existence of a slightly crippled instance of Ruby preinstalled on most OS X 10.4 systems, we’ll go through the steps for building almost everything from scratch.
Fortunately there is now a better way: the one-click Ruby installer for OS X.
This package is the most simple way to equip your Macintosh Apple OSX System with Ruby – similar to the Windows Ruby One-Click Installer. It replaces the broken Readline library, updates to a current version of SQLite3 and prepares your OSX for Rails, which needs at least Ruby 1.8.4 to run. The current Ruby Version is 1.8.6 (1.8.5 is recommended for Rails) and Rubygems 0.9.4.
I’ve had a chance to try it, and I give it two thumbs up. If you’re looking for an easy way to install Ruby and its red relatives on OS X, give it a try. (Of course, if you’re the sadistic type who wants to do everything by hand, nobody is going to stop you).


For sure, MacPorts works well. I’ve used it in the past. My only problem with it is that it’s slow. Compiling all the stuff takes a long time! Hampton still makes fun of me for the eight hours it once took to get Ruby/Rails installed via MacPorts.
Compiling everything you need yourself is faster only because you don’t need to get all the dependencies that MacPorts needs to install the libraries you actually want.
One thing I don’t like about the Ruby one-click for OS X is that it doesn’t install a compiler for you. It cites the fact that you “don’t need the Apple Developer Tools (xcode)” as a feature, but installing the developer tools is the easiest way to get the gcc compiler rigged up on your system. And if you want to compile some choice Gems, you need a compiler.
Also, although the Ruby one-click installer includes SQLite, you’ll probably want MySQL. Especially if you want to follow along with the book.
Currently, the best solution to install Rails on OS X seems to be: