Installing Rails on Mountain Lion Without Xcode

I admit it: I'm a Rails noob. 100%. Totally. As a result, this post may be useful to 0.000001% of all starting Rails developers out there.

A while ago*, I pre-purchased Agile Web Development With Rails and for some reason decided to try it out this morning. Of course, as the book says, "neither Snow Leopard nor Lion prepackage Ruby 1.9.3, you’ll need to download and build it yourself." Goody. And neither does Mountain Lion (10.8). I'm also quite used to living in a Windows world where you just install whatever you need. 

After a bit of searching, here's what you need to do to get Rails up and running without worrying about Xcode.

  1. Install the Command Line Tools (115 Mb). You will need an Apple Developer Account.
  2. Open Terminal and run the following commands
    1. curl -L | bash -s stable --ruby
    2. (Optionally) rvm current should display ruby-1.9.3-p194 (or later)
    3. gem install rails

Note: You can skip steps 2.2 and 2.3 if you replace step 2.1 with curl -L | bash -s stable --rails; I was trying to mimic the instructions in the book a bit.

At this point you should be able to run rails -v and get a response (e.g. Rails 3.2.8).

* claims I bought it March 18, 2011 (520 days ago). I think it's trying to make me feel bad.

comments powered by Disqus