Here is a script that I wrote and have been using, should work on most Linux's and OSX to bootstrap a Rails Development environment. Also ensures that git is installed. You can run it with one command (after reading it's contents of course) as follows:
curl -O https://github.com/wayneeseguin/rvm/blob/master/contrib/boot... && source bootstrap_rails_environment
This automates installing the prerequisites across many Linux package management types and then bootstraps a Rails development environment using RVM.