Copy and paste this line the Terminal and press Enter. It will take quite some time (approximately 30 minutes). Installer might ask for your administrator password. Grabbing a refreshing drink before starting is encouraged!
bash < <(curl -s https://raw.github.com/AhmedNadar/Rails-Installation/master/install-rails-osx-10.sh)
By Ahmed Nadar.