删除 ruby​​ 版本 [英] Deleting versions of ruby

查看:27
本文介绍了删除 ruby​​ 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了让 gem 正常工作,按照 SO 建议,我删除了旧版本的 ruby​​,如下所示:

Trying to get a gem working so, following a SO suggestion, I deleted older versions of ruby I had as follows:

$ which -a ruby
/Users/snowcrash/.rvm/rubies/ruby-1.9.2-p318/bin/ruby
/Users/snowcrash/.rvm/bin/ruby
$ rm /Users/snowcrash/.rvm/bin/ruby

然而,几个小时后我再次尝试了 which -a ruby​​ 并且这个文件返回了:

However, a couple of hours later I tried which -a ruby again and this file had returned:

/Users/snowcrash/.rvm/bin/ruby

有什么建议是怎么发生的吗?

Any suggestions how that happened?

运行 Mac OS X 10.8.2.

Running Mac OS X 10.8.2.

推荐答案

我认为您的 RVM 安装很混乱,因为您试图以不受支持的方式删除 Ruby.

I think your RVM installation is confused because you tried to delete Ruby in an unsupported way.

RVM 为您管理您的 Ruby,这是可以理解的,在 RVM 之外对其中的 Ruby 进行操作,真的会搞砸.换句话说,不要在线条之外着色.

RVM manages your Rubies for you and it's pretty understandable that doing things outside of RVM to the Rubies inside it, will really mess it up. In other words, don't color outside the lines.

照原样,我会使用 rm -rf ~/.rvm 吹走 ~/.rvm 并重新安装 RVM 并让它重新安装你想要的红宝石,然后在您真正了解 RVM 的工作原理和管理安装之前,不要理会内部结构.

As is, I'd blow away ~/.rvm using rm -rf ~/.rvm and reinstall RVM and let it reinstall the Rubies you want, then leave the internals alone until you really understand how RVM works and manages the installations.

而且,当您按照建议使用诸如 which ruby​​ 之类的简单命令删除某些内容的所有版本时,请保持怀疑.Ruby 安装不仅仅是解释器.此外,某些系统,如 Mac OS,安装 Ruby 供自己使用,删除 Apple 安装的系统版本可能会破坏应用程序.重新安装这些版本真的很痛苦,所以在删除属于某种语言的文件时要小心谨慎,除非您真的知道自己在做什么.

And, when you follow suggestions to delete all versions of something using a simple command like which ruby, be very skeptical. There is a lot more to a Ruby installation than just the interpreter. Also, some systems, like Mac OS, install Ruby for their own use, and deleting the Apple-installed system version can break apps. Reinstalling those versions is a real pain, so tip-toe carefully when removing files belonging to a language unless you really know what you're doing.

这篇关于删除 ruby​​ 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆