How to Upgrade Your Ruby With RVM In Ubuntu

February 04, 2013

What is RVM?

RVM (ruby version manager) is a tool that easily allows you to switch between multiple ruby versions (and associated gems you want to use with each ruby version) on OSX and Linux. The upshot is you can have different versions of the ruby on rails framework, the ruby language, and any associated gems you want to use segmented by “gemsets” or configurations. In other words, you can specify a particular “gemset” (or configuration) for each application you’re programming.

To make this more concrete, suppose you’re writing an application in Rails 2.3.15 and you only want to use a certain ruby version and associated gems with it. No problem. You just have to create a “gemset” and install all the gems, specific rails version, and ruby version you want. Now you don’t have to try and manage the configuration yourself. You simply switch to the “gemset” you want to use for your Rails 2.3.15 application and you’re ready to roll.

This definitely made life much easier in the long run and was the suggested path of action in the rails tutorial book.

How to Do the Upgrade

Step 1: Get the latest stable rvm

Type this at the command prompt:

rvm get stable

This upgrades your rvm toolset to the most stable release.

Step 2: List the known rubies and decide which one to upgrade to

Once you have the latest stable rvm, you can have it list out the known ruby versions it can help you upgrade to. Type this at the command prompt:

rvm list known

Now decide which ruby version to upgrade to.

Step 3: Upgrade

If you’re running ruby 1.9.3 patch 194, and you want to upgrade to ruby 1.9.3 patch 374, then type:

rvm upgrade 1.9.3-p194 1.9.3-p374

A few minutes later, you’re done!