Prepare Your System
Update your package manager first:
sudo apt-get update
Ensure Curl is installed:
sudo apt-get install curl
If you have an older version of Ruby installed on your computer, there’s no need to remove it. RVM will leave your “system Ruby” untouched and use your shell to intercept any calls to Ruby. Any older Ruby versions will remain on your system and the RVM version will take precedence.
The RVM website explains how to install RVM. Here’s the simplest way:
\curl -L https://get.rvm.io | bash -s stable --ruby
sudo apt-get install nodejs
Check the Gem Manager
RubyGems is the gem manager in Ruby. Check the installed gem manager version:
You may see:
Use this to upgrade the Ruby gem manager:
gem update --system
Ruby on Rails Installation
Many developers prefer to keep the global gemset sparse and install Rails into project-specific gemsets, so each project has the appropriate version of Rails.
If you install Rails at this point, you will install it into the global gemset.
Instead, make a gemset just for the current stable release:
rvm use firstname.lastname@example.org --create
Now you can install the most recent stable release:
gem install rails
And now you should have rails installed! I got these instructions from this RailsApps page. They go on to offer advice on setting up a Rails project directory and more.