VOOZH about

URL: http://rvm.io/gemsets/initial

⇱ RVM: Ruby Version Manager - Gemset initialization in RVM


👁 RVM Logo
Support
RVM is maintained by community of volunteers, report issues to RVM issues tracker.
If you can help or wish to become one of the maintainers - just start helping. You can find more RVM related projects at RVM Github organization.
Donation
Love RVM? Help us maintain RVM, a donation can help with it. Want to help in other way, want to be a sponsor?
contact: Michal Papis
Sponsors
👁 Fastly
Carbon Ads
Documentation  >  Gemsets  >  Gemset Initialization in Ruby Installs

Initializing Gemsets during Ruby Installs

When you install a new ruby, RVM not only creates two gemsets (the default, empty gemset and the global gemset), it also uses a set of user-editable files to determine which gems to install.

Working in ~/.rvm/gemsets, rvm searchs for global.gems and default.gems using a tree-hierachy based on the ruby string being installed. Using the example of ree-1.8.7-p2010.02, rvm will check (and import from) the following files:

  • ~/.rvm/gemsets/ree/1.8.7/p2010.02/global.gems
  • ~/.rvm/gemsets/ree/1.8.7/p2010.02/default.gems
  • ~/.rvm/gemsets/ree/1.8.7/global.gems
  • ~/.rvm/gemsets/ree/1.8.7/default.gems
  • ~/.rvm/gemsets/ree/global.gems
  • ~/.rvm/gemsets/ree/default.gems
  • ~/.rvm/gemsets/global.gems
  • ~/.rvm/gemsets/default.gems

For example, if you edited ~/.rvm/gemsets/global.gems by adding these two lines:

bundler
awesome_print

every time you install a new ruby, these two gems are installed into your global gemset.

Using the default or global gemsets, you can also make RVM include a specific version of a given gem. Here's how:

bundler -v~>1.0.0
awesome_print
hirb -v0.4.5

By default, rvm uses these gemsets to install common libraries (such as rake, and in the case of jruby, jruby-openssl.)

Warning

default.gems and global.gems files are usually overwritten during update of rvm (rvm get ...).

It is however possible to override this behavior by either using after_install hook or overriding with --with-default-gems/--with-gems flags during install / upgrade.

RVM Documentation Index | RVM Blog
RVM Interpreters Rubies
Gemsets Set Actions Workflow Deployment
Integration
Packages Presentations Help & Support Quality Assurance Development Credits
∞ Copyright © 2009-2011 Wayne E. Seguin © 2011-2017 Michal Papis © 2016-2017 Piotr Kuczynski ∞ Built with Nanoc ∞ Cached by Fastly ∞ Tested by Travis CI