Uninstall all installed gems, in OSX?

后端 未结 13 1237
别那么骄傲
别那么骄傲 2020-12-07 07:07

There are instances where I would like to revert and uninstall all previous gem installations.

For instance, I needed to assist a friend migrate their rails developm

13条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 07:24

    And for those of you who are here because you want to remove all gems with a certain prefix (ahem I'm looking at you aws-sdk!) you can run something like this:

    gem list --no-version | grep "aws-sdk-" | xargs gem uninstall -aIx
    

    Obviously put in your query instead of aws-sdk-. You need the -I in there to ignore dependencies.

    Adopted form Ando's earlier answer

提交回复
热议问题