mercoledì 6 aprile 2011

How to remove all Rubygems inside a RVM gemset

The only way to uninstall all the gems inside a RVM gemset is to use the following command:
$ rvm use 1.9.2@my-gemset
Using /home/user/.rvm/gems/ruby-1.9.2-p180 with gemset my-gemset
$ gem uninstall gem1 gem2 gem3 ...
A bit boring, don't you think? A way to automate this process is through the following command:
gem uninstall `gem list | cut -d" " -f1 | tr '\n' ' '`
If you don't use RVM to manage different Ruby versions, maybe you have to change the command above in something like this:
sudo gem uninstall `sudo gem list | cut -d" " -f1 | tr '\n' ' '`
Pay attention to copy all the "`" characters.
In this way you can uninstall all the gems only with one command.
Hope this helps :-)

Nessun commento:

Posta un commento