Uninstall all installed gems, in OSX?

后端 未结 13 1206
别那么骄傲
别那么骄傲 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:31

    Use either

    $ gem list --no-version | xargs gem uninstall -ax
    

    or

    $ sudo gem list --no-version | xargs sudo gem uninstall -ax
    

    Depending on what you want, you may need to execute both, because "gem list" and "sudo gem list" provide independent lists.

    Do not mix a normal "gem list" with a sudo-ed "gem uninstall" nor the other way around otherwise you may end up uninstalling sudo-installed gems (former) or getting a lot of errors (latter).

提交回复
热议问题