Dean Perry

— IT Technician & Web Developer

Setting up a Ruby on Rails development environment on Mountain Lion

Having just installed Mountain Lion on my MBA, I encounted a few small problems while trying to install RVM as well as Ruby, etc. Below are the steps I took to get Ruby on Rails up and running on my new Mountain Lion install.

Step 1. Install XCode (this isn't required but it's best to install it)

Step 2. Install the XCode Command Line Tools from developer.apple.com. Note you need to download the 10.8 command line tools which is at the bottom of the list on XCode 4.4. I made the mistake of downloading the 10.7 Lion set first!

Step 3. Install XQuartz

Step 4. Install HomeBrew ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Step 5. Check that HomeBrew works OK brew doctor

Step 6. Install GCC 4.2 because Mountain Lion doesn't come with it by default.

brew tap homebrew/dupes
brew install apple-gcc42
sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2

Step 7. Install RVM

Step 8. Install Ruby! rvm install 1.9.3 for the latest version of Ruby 1.9.3

Step 9. Set 1.9.3 as the default ruby - rvm use 1.9.3 --default

Step 10. Install the base gems - gem install rails bundler

Step 11. Install Pow which is a brilliant Ruby development server. No need to keep running rails server all the time. curl get.pow.cx | sh

Step 12. Install Git brew install git

Step 13. (optional). Install MySQL using homebrew brew install mysql. It looks like Java is required as well during installation for some reason.

Comment 22 Comments

  1. mpbod
    Max Bodhisuwan – 10 months ago

    Thanks Dean for this great guide, got me up to speed very fast.

  2. DeanPerry
    Dean Perry – 10 months ago

    Glad to hear it helped :)

  3. fschuindt
    Fernando Schuindt – 8 months ago

    Thank you, man. Its made me understand somethings.

  4. DeanPerry
    Dean Perry – 8 months ago

    No probs, glad to hear it helped :)

  5. RobertDaly
    Rob Daly – 7 months ago

    Thanks, Dean. I have goofed around quite a bit the past few days, and stumbled on this page in frustration after yet another "almost there" attempt. Your instructions worked flawlessly.

  6. DeanPerry
    Dean Perry – 7 months ago

    Cool, thanks. I found the same when trying to setup Rails on Lion before so I thought I'd create a simple post for Mountain Lion :)

  7. DeanPerry
    Dean Perry – 7 months ago

    Thanks, I've updated the post :)

  8. dazl
    davide zilioli – 7 months ago

    Thanks Dean I used your writeup and everything went smooth. I am going to have to repeat this on several machines and am investigating the best way to automate the process -- I'll start from scratch if needed but if anyone knows of an existing solution t

  9. zue666
    Ahmed Obaidy – 5 months ago

    thank you Dean .. the best installation method ever ...

  10. negritosuave
    Von – 5 months ago

    Just used your method tonight/this morning to set up Rails on Mountain Lion (10.8.2) inside a VM (Windows 7 host). Flawless victory. Thanks a lot for posting it!

  11. atduskgreg
    Greg Borenstein – 4 months ago

    Thanks for this! You should add Postgres.app to it: http://postgresapp.com Waaaaay the easiest way to get up and running with postgres, which is otherwise harder on Lion and Mountain Lion than it should be.

  12. DeanPerry
    Dean Perry – 4 months ago

    Thanks for the comment. I don't use Postgres yet so that doesn't apply to me.

  13. wonbyte
    Greg Sieranski – 4 months ago

    Great Guide! Hope you do the next major Apple OS Release!

  14. DeanPerry
    Dean Perry – 4 months ago

    I'll definitely be doing a new post when the next Apple OS comes out :)

  15. ernientrish
    Ernie Weaver – 4 months ago

    After struggling all day trying to install Ruby on Rails, I stumbled here. It was fast, easy to follow, and simple! Thank you!

  16. DeanPerry
    Dean Perry – 4 months ago

    Sounds great, thanks! :)

  17. marothstein
    marothstein – 3 months ago

    Enjoyed this, thank you!

  18. DeanPerry
    Dean Perry – 3 months ago

    GitHub released it about a week ago and I've not had chance to look into yet. It does look quite good though.