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.
Thanks Dean for this great guide, got me up to speed very fast.
Glad to hear it helped :)
Thank you, man. Its made me understand somethings.
No probs, glad to hear it helped :)
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.
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 :)
For Install HomeBrew /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)" gives you a 404.
There new install line is: ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
Thanks, I've updated the post :)
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
Sounds great! :)
thank you Dean .. the best installation method ever ...
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!
Works great in 2013 -- thanks! Note for users attempting to install ruby 1.8.7, see this SO answer to resolve compiler error: http://stackoverflow.com/questions/11664835/mountain-lion-rvm-install-1-8-7-x11-error
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.
Thanks for the comment. I don't use Postgres yet so that doesn't apply to me.
Great Guide! Hope you do the next major Apple OS Release!
I'll definitely be doing a new post when the next Apple OS comes out :)
After struggling all day trying to install Ruby on Rails, I stumbled here. It was fast, easy to follow, and simple! Thank you!
Sounds great, thanks! :)
Enjoyed this, thank you!
Why not use boxen, an automatic script developed by Github to setup their RubyOnRails development laptops:
http://boxen.github.com/
GitHub released it about a week ago and I've not had chance to look into yet. It does look quite good though.
No one has commented on this post yet. Be the first!