RVM will take care of downloading, unpacking and compiling the requested Ruby.

You may not find the Ruby version that you are looking for if using an outdated version of RVM. Use the following command to first update your list of available versions:

$ rvm get stable

How to uninstall an existing Ruby version?

You can uninstall an existing RVM-managed Ruby version by executing:

$ rvm uninstall ruby-1.9.1-p431

What is RVM?

RVM (Ruby enVironment Manager) is a command-line tool which allows you to easily install, manage, and work with multiple Ruby environments from interpreters to sets of gems.

Every installed Ruby using RVM is isolated in its own directory with its libraries and gems. This is convenient if you need to maintain multiple projects, dependent on different Ruby versions.

RVM also has a very flexible gem management system called "named gemsets". These gemsets allows defining independent groups of gems, which is really convenient to maintain multiple projects with different set of gems. This is partially addressed by Bundler, but while Bundler just takes care of installing and selecting the appropriate Gem version, RVM completely isolate the gem sets into its own GEM_PATH. Also, not all your applications will be compatible with Bundler. It is also possible to use a combination of both, which will make sure you won't get in any trouble when working with different gem requirements.

Because of the above mentioned features, RVM is a perfect asset for your development process but that does not mean it is not suitable for production environments thanks to its ability to make setting up rubies / gems very efficient. It will also allow you to test your application in multiple Ruby versions so you will have a consistent environment from development, through testing, and into production.

Prerequisites

To make use of RVM, you must have a compilation environment set up in your machine. You will need this compilation environment mostly to compile new Ruby versions but it will be also needed to compile some gems such as nokogiri.

Find a detailed list of the packages to install by executing:

$ rvm requirements

This will include more packages than really necessary as the Bitnami Ruby Stack already includes most of the required libraries.

Execute the command below to install the minimum list of required packages:

After enabling this feature, when entering a directory containing an .rvmrc file, you will receive a warning message asking for permissions to use the .rvmrc file:

====================================================================================
= NOTICE =
====================================================================================
= RVM has encountered a new or modified .rvmrc file in the current directory =
= This is a shell script and therefore may contain any shell commands. =
= =
= Examine the contents of this file carefully to be sure the contents are =
= safe before trusting it! ( Choose v[iew] below to view the contents ) =
====================================================================================
Do you wish to trust this .rvmrc file? (/home/bitrock/rubystack-3.2.3-0/rvm/.rvmrc)
y[es], n[o], v[iew], c[ancel]>

If you know the contents of the file and that it is safe, accept. You will receive this message every time a new .rvmrc file is found or when a known .rvmrc file changes.

Change into the project directory and use rvm to create the sample .rvmrc file. For example, if you want to use Ruby 1.9.3 with the gemset bitrock-sample, use thse commands: