However things are much easier. Ruby and RoR are available as packages in the repos.
Install Ruby on Ubuntu 14.04 - actually it comes preinstalled. To check your Ruby version type in terminal:
ruby -v
On my machine it's outputs: "ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]"
Install Ruby on Rails on Ubuntu:
sudo apt-get install ruby-railties-4.0 // this will install RoR 4.0
sudo apt-get install ruby-railties-3.2 // this will install an earlier version of RoR