Removing All Ruby Gems 2.0.0

It seems that ruby ​​2.0.0 has added "default" to the mix and makes them not removable with gem uninstall.

How to remove all non-standard stones?

+42
ruby gem
Feb 26 '13 at 22:19
source share
4 answers

I used this one line script.

for i in `gem list --no-versions`; do gem uninstall -aIx $i; done 

It ignores the default gem errors and just keeps working. Simple and self-evident.

+83
Feb 28 '13 at 11:10
source share

First go to the gem catalog How .. / ruby ​​/ 2.0.0-p195 / lib / ruby ​​/ gems / 2.0.0 / specifications
You will find a directory with a default name that includes all the default gems shipped with ruby ​​2.0

Move all *. gemspec stored in the default directory in the specification and delete the empty default directory.

Then you can do whatever you want, as in the old days. :-)

+9
Jun 30 '13 at 10:12
source share

I wrote a script in ruby ​​to remove all non-standard stones.

https://gist.github.com/nixpulvis/5042764

This is necessary now, because unlike 2.0.0, some gems are marked as "default" with the ruby ​​installation and cannot be removed using gem uninstall . This makes previously popular methods for removing all stones inoperative.

For reference here.
gem list | cut -d" " -f1 | xargs gem uninstall

+4
Feb 26 '13 at 22:19
source share

I have not yet found a better answer than to exclude the "default" stones:

 /usr/local/bin/gem list --no-versions | \ grep -v -E "(bigdecimal|io-console|json|minitest|psych|rake|rdoc|test-unit)" | \ xargs --no-run-if-empty /usr/local/bin/gem uninstall --executables --user-install --all --force 
0
Feb 11 '14 at 18:13
source share



All Articles