如何完全卸载 rails、ruby 和 rubygems?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2430059/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I completely uninstall rails, ruby and rubygems?
提问by JZ.
My system is F'd. How do I completely uninstall rails, ruby and rubygems?
我的系统是F'd。如何完全卸载 rails、ruby 和 rubygems?
any suggestions on where to go to reinstall from scratch? Best practices? I'd like to get back to 3.0 beta
关于从头开始重新安装的任何建议?最佳实践?我想回到 3.0 测试版
Thanks!
谢谢!
采纳答案by Simone Carletti
I suggest you to simply uninstall all Gems using gem uninstall [name_of_gem], then use RVMto install a new Ruby version and make it the default one.
我建议您简单地使用 卸载所有 Gems gem uninstall [name_of_gem],然后使用RVM安装新的 Ruby 版本并将其设为默认版本。
RVM also makes incredibly easy to remove a Ruby version and all its data since it installs everything in a folder within your home directory.
RVM 还可以非常轻松地删除 Ruby 版本及其所有数据,因为它将所有内容安装在您的主目录中的文件夹中。
回答by raptor
You can use gem uninstallto delete all gems as follows:
您可以使用gem uninstall删除所有 gem 如下:
gem list --no-version | xargs gem uninstall
If you want to keep eg. the gem rake:
如果你想保持例如。宝石rake:
gem list --no-version | grep -v "rake" | xargs gem uninstall
To delete only the old versions, you can run gem clean.
要仅删除旧版本,您可以运行gem clean.
Also, it is possible to write all gems in a list:
此外,可以将所有 gem 写入列表:
gem list --no-version > gem_list.txt
and define these you want to delete:
并定义要删除的这些:
cat gem_list.txt | xargs gem uninstall
or install:
或安装:
cat gem_list.txt | xargs gem install
(eventually you have to put a sudoin front of a gem command. On windows use an unix console enviroment like msysGit)
(最终你必须sudo在 gem 命令前面放一个。在 Windows 上使用像 msysGit 这样的 unix 控制台环境)
回答by Ravi Kant
Use
用
$gem clean
$gem 干净
for delete all the gems.
删除所有宝石。

