Do not use
sudo apt-get install ruby-rvm to install the RVM that comes with Ubuntu because it will not work well.
First, be sure to setup the terminal to work with RVM.
Now you can install RVM and Ruby:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 curl -sSL https://get.rvm.io | bash -s stable --ruby ruby -v
A common thing to do at the point is install bundler, which is Ruby’s dependency manager, and use it to install your project’s dependencies and then run rake.
gem install bundler bundle install rake