List gemsets for a given Ruby version

RVM allows you to define multiple groups of gems (gemsets) for your RVM-managed Rubies. This is specially useful in those applications not managed using Bundler.

Select an installed Ruby using:

$ rvm use 1.9.3

Then, get the list of defined gemsets by executing:

$ rvm gemset list

gemsets for ruby-1.9.3-p194 (found in /opt/rubystack-3.2.3-0/rvm/gems/ruby-1.9.3-p194)

In this example, two gemsets are available, global (the default gemset with the gems that are available to all other gemsets) and project-sample, a custom gemset created for a sample project.

Create a gemset

To create a new gemset, execute a command like the one below:

$ rvm gemset create GEMSET-NAME

Select a gemset for a given Ruby version

To select a gemset for a given Ruby version, use this command:

$ rvm gemset use GEMSET-NAME

Share gems between all the gemsets

RVM defines a global gemset which is shared among all the gemsets for a specific Ruby version. To install a shared gem, execute:

$ rvm gemset use global
$ gem install rails
$ rvm gemset use GEMSET-NAME
$ gem list rails
Last modification April 8, 2020