从 rbenv 卸载 ruby​​ 版本

发布于 2025-01-02 13:32:21 字数 168 浏览 3 评论 0原文

如何从 rbenv 卸载或删除 ruby​​ 版本。我安装了两个版本的 ruby​​。当切换到 ruby​​ 1.9.3 时,我遇到了分段错误。任何人都可以帮忙,如何从 rbenv 中删除特定版本?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

痴梦一场 2025-01-09 13:32:21

新方法

使用uninstall命令:rbenv uninstall [-f|--force]

rbenv uninstall 2.1.0  # Uninstall Ruby 2.1.0

使用rbenv versions code> 查看您安装的版本。


旧方法

要从 rbenv 中删除 Ruby 版本,请删除 ~/.rbenv/versions 中的相应目录。例如

rm -rf ~/.rbenv/versions/1.9.3-p0

,随后运行 rbenv rehash 来清理已删除版本中任何陈旧的填充二进制文件。

New way

Use the uninstall command: rbenv uninstall [-f|--force] <version>

rbenv uninstall 2.1.0  # Uninstall Ruby 2.1.0

Use rbenv versions to see which versions you have installed.


Old way

To remove a Ruby version from rbenv, delete the corresponding directory in ~/.rbenv/versions. E.g.

rm -rf ~/.rbenv/versions/1.9.3-p0

Run rbenv rehash afterwards to clean up any stale shimmed binaries from the removed version.

固执像三岁 2025-01-09 13:32:21

ruby-build 现在向 rbenv 添加了一个 卸载命令 来处理 ruby​​ 版本的删除(如果您愿意的话)避免手动 rm -fr (这可能被认为有风险)和 @Stephenson 建议的 rbenv rehash。要删除 ruby​​ 版本 1.9.3-p0,您将运行以下命令:

rbenv uninstall 1.9.3-p0

ruby-build now adds an uninstall command to rbenv to handle the removal of ruby versions, if you want to avoid manual rm -fr (which might be considered risky) and rbenv rehash suggested by @Stephenson. For removing ruby version 1.9.3-p0 you would run the following:

rbenv uninstall 1.9.3-p0
用心笑 2025-01-09 13:32:21

就像史蒂芬森说的,但记得改变版本&如果它们引用已删除的版本,则为全局。

Like Stephenson said, but remember to change version & global if they are referencing the deleted version.

慕巷 2025-01-09 13:32:21

正确的命令在其他答案中有很好的解释,但是如果您尝试卸载 jruby,那么您需要在命令中显式提及 jruby ,后跟连字符,然后是 gem 版本,例如:

rbenv uninstall jruby-9.2.16.0

The correct command is well explained in other answers, However if you are trying to uninstall jruby then you need to explicitly mention jruby in command followed by hyphen and then gem version, For example:

rbenv uninstall jruby-9.2.16.0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文