In the last tutorial we learnt how to install RVM. In this one we will take one step further by creating Gemsets.
Note - Gemsets are used to eliminate Gem clutter and version mismatches. Also by creating Gemsets we can install multiple versions of Gems for same version of Ruby (p.s. You can even install different versions of Rails for same version of Ruby).
Back to theTestbed - Suppose we have Ruby 1.9.3 and Ruby 1.8.7 installed in our system.
To switch to Ruby 1.9.3 we will use the below mentioned command in our terminal
This will switch to Ruby 1.9.3
Now we will create a newGemset
rvm gemset create test
This will create a new Gemset by the name of test which will be using Ruby 1.9.3. To use this Gemset use the command
This will switch you to the newly created Gemset. Now you can install whichever Gem you want pertaining to your requirements. You can install Rails and then create a new Gemset for the same ruby version and then again switch to the new Gemset and install a new version of Rails.
Every Gemset is isolated from the other one so you need not care about managing Gems any further. Each Gemset will contain Gems which you will install for that particular Gemset.
Isn't it cool?
Now go on create some Gemsets and play around with various versions of Gems.