How to install Rails for Ruby
sudo gem install rails
This process may take a while, be patient with it.
If you are feeling especially antsy, you can type in:
sudo gem install rails -V
Terminal will then show you all the details of the process, so you can see that it is working.