Looking for something like gem list
within an RVM gemset but to have it ignore gems in the global and default gemsets so I can see, easily, exactly what gems are in the active gemset (and only the active gemset).
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 .
You need to "rvm gemset empty [gemset_name]". I suppose if you have many gems, it could take a while to uninstall them all. Incidentally right now I am able to run rvm gemset empty and it clears the current gemset.
If you are using RVM(Ruby Version Manager) then using a gemset for each project is a good idea. 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.
for global:
rvm @global do gem list
for other gemsets:
GEM_PATH=$GEM_HOME gem list
@global
is a gemset that all other gemsets inherit for given ruby, it does not inherit for m itself so it's safe to select it and run gem list
in it's context.
For all other gemsets you can use the fact that gem list
displays gems from all paths available in GEM_HOME
and GEM_PATH
, resetting GEM_PATH
to be equal GEM_HOME
will make only one path available - the one from GEM_HOME
so gem list
will only show gems in the selected gemset, ignoring all other gemsets (at this time the @global
, but RVM 2.0 will support multiple gemsets inheritance).
Simplest way to do it is to use bash command which show list of directories in your current gemset directory
$ ls `rvm gemdir`/gems
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With