Install homebrew. You should be prompted to install the Xcode Command Line Tools.
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Make sure it 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
ZSH users use
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