How do I use RVM and create globally available gems?

add the the gems you want for every gemset in a "global" rvm gemset name i.e.

rvm 1.9.2@global

then project specific gemsets rvm 1.9.2@myProject will already have you're "default" gems from your global list


There is something called the global gemset, and it is shared between all your gemsets of a certain ruby-version. But you can't share gems between ruby-versions.

However, what you can do is create a list of gems that will be installed automatically when adding a new ruby version. That is described here. In short: edit a file called ~/.rvm/gemsets/global.gems to contain the list of gems you want to be there for each ruby-version.

Hope it helps.


With the latest RVM version (1.17.0 and newer) just type:

rvm @global do gem install passenger

or

rvm 1.9.3@global do gem install passenger if you need it only for a specific version of ruby.


You can create and use global gemsets with the following commands:

rvm gemset create global
rvm gemset use global

After you've created and execute use for the global gemset simply install gems as usual:

gem install mysql passenger