Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between rvm default and global gemset

Tags:

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.

like image 332
Karan Avatar asked Aug 13 '13 00:08

Karan


1 Answers

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.

like image 175
mpapis Avatar answered Sep 20 '22 18:09

mpapis