Home - Archives - About Me - Feed

Ruby Version Manager

04.06.2012

I’m a Groovy developer. As you might know, I love to learn and play with other programming languages.

This time, it’s the turn of the Ruby programming language. Ruby has a great ecosystem, there are a plenty of projects, libraries and tools. In fact, this blog is powered by toto and right now I’m creating a new static site with Jekyll.

To develop these projects, I need to use different Ruby versions and gems. The established leader in the Ruby version management scene is RVM and rbenv is an alternative.

RVM

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

I have taken some notes that I think you will find helpful if you are starting with RVM.

Install RVM:

curl -L get.rvm.io | bash -s stable

Display a list of all “known” rubies:

rvm list known

Install Ruby:

rvm install 1.9.3

I had issues with zlib and openssl, I reinstalled Ruby including these packages:

rvm pkg install zlib openssl
rvm reinstall 1.9.3 --with-zlib-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr

Switch beetween Ruby versions:

rvm 1.9.3
rvm system

The project .rvmrc files is intended to be used to setup your project’s Ruby environment when you switch to the project root directory.

Create a project specific .rvmrc file:

rvm --rvmrc --create 1.9.3@project