virtualMachineruby

Get started with 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:

  • Debian:

    $ sudo apt-get install build-essential autoconf automake libtool bison
    
  • CentOS:

    $ sudo yum groups mark install "Development Tools"
    
Last modification September 5, 2018