Uninstalling all gems Ruby 2.0.0

后端 未结 4 1668
攒了一身酷
攒了一身酷 2020-12-04 07:38

It seems that ruby 2.0.0 has added \"default\" gems to the mix and makes them non removable by gem uninstall.

How can you remove all non default gems?

4条回答
  •  心在旅途
    2020-12-04 08:44

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

    /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
    

提交回复
热议问题