Ejemplo de uso de gemsets

To illustrate the point, let's talk about a common use case. Assume you are testing out a rails application against a new Rails release. RVM makes such testing very easy, by letting you quickly switch between multiple Rails versions. First, let's set up the environments:

$ rvm 1.9.2-head
$ gem install rails -v 2.3.3

$ rvm gemset create rails222 rails126
Gemset 'rails222' created.
Gemset 'rails126' created.

$ rvm 1.9.2-head@rails222
$ gem install rails -v 2.2.2

$ rvm 1.9.2-head@rails126
$ gem install rails -v 1.2.6

$ rvm 1.8.7
$ gem install rails -v 1.2.3
Note that, for each of the ruby installs above, you can have completely separate versions!

Now that your environments are set up, you can simply switch between Rails versions and Ruby versions as follows.

$ rvm 1.9.2-head@rails126 ; rails --version

Rails 1.2.6

$ rvm 1.8.7 ; rails --version

Rails 1.2.3

$ rvm 1.9.2-head@rails220 ; rails --version

Rails 2.2.0

$ rvm 1.9.2-head ; rails --version

Rails 2.3.3
If you are deploying to a server, or you do not want to wait around for rdoc and ri to install for each gem, you can disable them for gem installs and updates. Just add these two lines to your ~/.gemrc or /etc/gemrc:

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri

Casiano Rodriguez León 2015-01-07