简体   繁体   中英

Difference between rvm default and global gemset

I was on the default gemset on rvm. I then did a bundle install, and it did not install any gems since all of them had been installed.

I then switched to the global gemset; did a bundle install, and it started installing gems.

List of gemsets are:

root@dev:/home/karan/realestate# rvm gemset list

gemsets for ruby-2.0.0-p195 (found in /usr/local/rvm/gems/ruby-2.0.0-p195)
   (default)
=> global

I thought that the global and the default had the same gemset folder.

Global is documented at rvm site - http://rvm.io/gemsets/global :

Gems you install to the @global gemset for a given ruby are available to all other gemsets you create in association with that ruby.

This is a good way to allow all of your projects to share the same installed gem for a specific ruby interpreter installation.

As for default it is just the gemset when you do not specify a gemset name, this is why it is listed in brackets in rvm gemset list :

gemsets for ruby-2.0.0-p247 (found in /home/mpapis/.rvm/gems/ruby-2.0.0-p247)
   (default)
   global
=> rvm-site

Where for both (default) and rvm-site all gems from global will be available.

You can select the default gemset by skipping the gemset name:

rvm use 2.0.0

or to switch to default of the current ruby - in case other was used:

rvm use @default

To access any gemset temporarily you can use:

rvm @global do gem install jist

This is especially useful for managing gems installed in global gemset - so those that will be available in all other gemsets of that ruby.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM