Nerian
Nerian

Reputation: 16177

RVM: Uninstalling all gems of a gemset

I have global gems and various gemsets. I want to remove all gems of a gemset. Is there a way do to this, besides uninstalling the gemset?

Upvotes: 144

Views: 64207

Answers (7)

Mukesh Kumar Gupta
Mukesh Kumar Gupta

Reputation: 1647

This is the safest way to uninstalling all gems of a gemset

Step 1

If you gem version is less then 2.1.

gem update --system

gem --version

Step 2

gem uninstall --all

references

Upvotes: 2

Matilda
Matilda

Reputation: 1718

you can also use rvm --force gemset empty

Upvotes: 13

Craig Walker
Craig Walker

Reputation: 51717

rvm gemset empty <gemset> works, but only if you specify a gemset name.

If you want to empty the default gemset, you need to pass an empty string for the gemset name.

rvm gemset empty mygems ""

Upvotes: 6

Ramiz Raja
Ramiz Raja

Reputation: 6030

rvm gemset empty <gemset name>

This will remove all gems from your mentioned gemset.

Upvotes: 12

Andy Lindeman
Andy Lindeman

Reputation: 12165

Use the gemset empty command:

rvm gemset empty mygems

Upvotes: 263

Sulabh Jain
Sulabh Jain

Reputation: 388

This command removes all the ruby gems installed locally in 1-step Works well in Ubuntu 10.10

gem list | cut -d" " -f1 | xargs gem uninstall -aIx

PS - removes all local gems. Use sudo accordingly.

Upvotes: 17

Upgradingdave
Upgradingdave

Reputation: 13056

Isn't removing all the gems out of a gemset essentially the same operation as deleting a gemset and then adding it back? Why not just do this:

$ rvm gemset mygemset
$ rvm gemset delete mygemset
$ rvm gemset create mygemset

Upvotes: 4

Related Questions