RVM made my life easier to run multiple versions of ruby and rails in Ubuntu.
 Installing RVM
If we want to maintain two different versions of gem under a single ruby version, we can create a named gemsets for different versions and switch between them easily.
Recently I came across something called gemsets.

The below command creates a gemset named gemsetname.
rvm 1.9.2@gemsetname –create

gemsetname can be gemset name can be anything meaningful related to the gem version
eg : railspre, rails307,rails234

rvm gemset list # lists all the gemsets under ruby version 1.9.2
gemsets for ruby-1.9.2-p180 (found in /home/spritle/.rvm/gems/ruby-1.9.2-p180)
   global
   rails30
   rails31
=> railspre

$ rvm 1.9.2-head@railspre
$ ruby -v
$ ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]
$ rails -v
$ Rails 3.1.0.rc4

So first I am selecting rails pre version and when I check the version it shows up rails 3.1, now I am switching to gemset rails307, after switching I am checking the verison and now its rails 3.0.7
$ rvm 1.9.2@rails307
$ rails -v
$ Rails 3.0.7

 

Advertisements