Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RVM see gems in gemset

How do I view a list of all the gems in a given gemset? And is it possible to use multiple gemsets at a time or only one?

like image 405
Kvass Avatar asked Mar 27 '12 18:03

Kvass


People also ask

How do I find my Gemset list?

However, to see the contents of a gemset, excluding the @global gemset, first do rvm use 2.0.0@some-gemset --ignore-gemsets (or similar for other Rubies) then gem list . Similarly to see the contents of the @global gemset, first do rvm use 2.0.0@global then gem list .

What is rvm Gemset?

Ruby on Rails Gems Gemsets A gemset is just a container you can use to keep gems separate from each other. Creating a gemset per project allows you to change gems (and gem versions) for one project without breaking all your other projects. Each project need only worry about its own gems. RVM provides (>= 0.1.

How do you use a Gemset?

Assuming that you are already on your project directory. Now run these commands from your CLI. Step 1: rvm gemset create [name of gemset] Step 2: rvm --rvmrc [ruby version here]@[name of gemset] # Note: You can check your current ruby version by running "ruby -v" from your console. Step 3: Refresh your directory.

How do I remove Gemset from rvm?

You need to specify the gemset you want to empty. It's not enough just to "rvm use [gemset_name]". You need to "rvm gemset empty [gemset_name]". I suppose if you have many gems, it could take a while to uninstall them all.


2 Answers

You can call gem list and it will display all the gems in your current gemset. You can only use one gemset at a time, but there is a hierarchy of gemsets. You can create a global gemset with (for example) rake and pry in it, and then any gemset you create (using the same version of ruby, of course) will inherit those gems into it.

like image 182
jnevelson Avatar answered Oct 24 '22 08:10

jnevelson


Usually the current Ruby's @global gemset is included in other gemsets.

To see the contents of a gemset, excluding the @global gemset, first do rvm use 2.0.0@some-gemset --ignore-gemsets (or similar) then gem list.

For the default gemset, do rvm use 2.0.0 --ignore-gemsets then gem list.

like image 42
MarkDBlackwell Avatar answered Oct 24 '22 08:10

MarkDBlackwell