https://developer.apple.com/downloads/
curl -L https://get.rvm.io | bash -s stable
don't forget to reload the terminal after this command.
Then configure rvm to automatically download dependencies with this command:
rvm autolibs enable
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
rvm install 1.9.3
gem update --system
gem install rails
rvm --create use 1.9.3@projectname