It seems every tutorial I find on the net has something wrong with it.  Its either out of date, or for the wrong operating system.  Many of the tutorials show you how to install Ruby on Windows or Mac, but no real instructions on how to install it in a production environment.  This strikes me as odd, I mean, whats the point of only having a development environment if you can’t eventually move it into production?

I found one tutorial that was on the right track, but sadly it was outdated, so here is an up-to-date version as of today, April 11, 2015.

First make sure your system is up to date:

If your system doesn;t already have curl, you will need to install it

Now we are going to install Ruby Version Manager (RVM)

Once installed you can start RVM with the following command:

To make sure RVM has the dependencies it needs to run, run the following command:

It will take a few minuted to install everything it needs.

Now we can install Ruby – Go to RubyOnRails.org/download/ to find the latest version

Then tell the system to use this version by default

RubyGems was already installed with the latest version of Ruby, so no need to install it. If you want to make sure just type:

Finally we install Rails

This takes a little while as it installs Rails and a few different Gems.

If you are using a server from Vultr and DigitalOcean make sure to make a snapshot before following any other tutorial online. It will save you reinstalling when the commands they tell you to type don;t work because they are 15 versions out of date.