在 OSX 中卸载所有已安装的 gem? [英] Uninstall all installed gems, in OSX?
问题描述
在某些情况下,我想恢复并卸载所有以前的 gem 安装.
There are instances where I would like to revert and uninstall all previous gem installations.
例如,我需要帮助一位朋友迁移他们的 Rails 开发机器以使用 RVM.由于他们之前一直在使用系统范围的 gem
,他在处理多个项目时遇到了很多麻烦.基本上,他是 RVM 皈依者的典型代表.
For instance, I needed to assist a friend migrate their rails development machine to use RVM. As they had been previously using the system-wide gem
, he was experiencing many headaches when working with multiple projects. Essentially, he was the poster-child for an RVM convert.
我怎样才能优雅地卸载他的 OSX 系统上的所有 gem?
How can I elegantly uninstall all of the gems on his OSX system?
推荐答案
Rubygems >= 2.1.0
gem uninstall -aIx
a
删除所有版本I
忽略依赖项x
包括可执行文件
a
removes all versions
I
ignores dependencies
x
includes executables
Rubgems <2.1.0
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done
这篇关于在 OSX 中卸载所有已安装的 gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!