Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install gem across all gemsets when using RVM

Tags:

ruby

rvm

Is there a way to install a gem across all rubies and gemsets (not just the default or the system ruby) in the system when using RVM?

like image 887
Faraaz Khan Avatar asked Jan 03 '12 03:01

Faraaz Khan


2 Answers

You can execute:

rvm @global do gem install [gem_name]

to install gem globally (per ruby version).

It is not possible to install gem globally for every ruby version.

According to https://rvm.io/gemsets/initial you can define automatically installed gems for every ruby version in file ~/.rvm/gemsets/global.gems. In this file you need to define required gems (one per line) e.g.

bundler
zeus

These gems will be installed each time you add new ruby version to the RVM.

like image 185
jmarceli Avatar answered Oct 01 '22 20:10

jmarceli


You can install to a default, global gemset per ruby interpreter as mentioned here:

https://rvm.io/gemsets/global/

and also this page mentions default gem sets

https://rvm.io/gemsets/using/

And it wouldn't be useful to install a gem to all ruby interpreters due to incompatibilities between rubies.

like image 21
Joc Avatar answered Oct 01 '22 20:10

Joc