从 rbenv 卸载 ruby 版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9147457/
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
uninstall ruby version from rbenv
提问by Thillai Narayanan
How to uninstall or remove ruby version from rbenv. I have installed two versions of ruby. While switching to ruby 1.9.3, I am getting segmentation fault. Can anyone please help, how to remove a particular version from rbenv?
如何从 rbenv 卸载或删除 ruby 版本。我已经安装了两个版本的 ruby。切换到 ruby 1.9.3 时,出现分段错误。任何人都可以帮忙,如何从rbenv中删除特定版本?
回答by Sam Stephenson
New way
新方法
Use the uninstallcommand: rbenv uninstall [-f|--force] <version>
使用uninstall命令:rbenv uninstall [-f|--force] <version>
rbenv uninstall 2.1.0 # Uninstall Ruby 2.1.0
Use rbenv versionsto see which versions you have installed.
使用rbenv versions查看已安装的版本。
Old way
老办法
To remove a Ruby version from rbenv, delete the corresponding directory in ~/.rbenv/versions. E.g.
要从 rbenv 中删除 Ruby 版本,请删除~/.rbenv/versions. 例如
rm -rf ~/.rbenv/versions/1.9.3-p0
Run rbenv rehashafterwards to clean up any stale shimmed binaries from the removed version.
rbenv rehash之后运行以清除已删除版本中任何陈旧的填充二进制文件。
回答by lorcan
ruby-build now adds an uninstall commandto rbenv to handle the removal of ruby versions, if you want to avoid manual rm -fr(which might be considered risky) and rbenv rehashsuggested by @Stephenson. For removing ruby version 1.9.3-p0 you would run the following:
ruby-build 现在向 rbenv添加了一个卸载命令来处理 ruby 版本的删除,如果你想避免手动rm -fr(这可能被认为是有风险的)和rbenv rehash@Stephenson 的建议。要删除 ruby 版本 1.9.3-p0,您将运行以下命令:
rbenv uninstall 1.9.3-p0
回答by Mauricio Pasquier Juan
Like Stephenson said, but remember to change version & global if they are referencing the deleted version.
就像斯蒂芬森说的那样,但如果他们引用已删除的版本,请记住更改版本和全局。

