These steps are for Mavericks. Mileage will vary for older versions of Mac OS X but the broad strokes still apply. Google is your friend if you hit a snag. Comments welcome.
Install homebrew.
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
You should be prompted to install the Xcode Command Line Tools. Go here: https://developer.apple.com/downloads/
Sign in with your Apple ID. If asked, agree to the Terms of Service.
Search command line tools
at top left. Download the most recent Command Line Tools for your operating system. Install those once downloaded.
Make sure Homebrew is setup appropriately:
$ brew doctor
You should see: Your system is ready to brew..
Setup rbenv and Ruby 2.0.0:
$ brew install rbenv
$ brew install ruby-build
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
Install bundler and rails:
$ gem install bundler
$ gem install rails
$ rbenv rehash
You should now be good to go!
Try starting here if you're new to Rails: http://guides.rubyonrails.org/getting_started.html#hello-rails-bang
Tip If a step isn't working, try to quit Terminal and reopen it. Some steps may require a Terminal restart depending on your system.
If you followed the directions above and you have Sublime Text 2, this will create a subl
symlink:
ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Change Sublime Text 2.app
to match the name of Sublime Text on your computer, if different. For example, if you have Sublime Text 3.