Deleting versions of ruby

倖福魔咒の 提交于 2019-12-31 05:31:25

问题


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

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?

Running Mac OS X 10.8.2.


回答1:


I think you only deleted either a stub or a symbolic link. It would likely be pointing to the other ruby installed above, in the longer path.




回答2:


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

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.

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.

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.



来源:https://stackoverflow.com/questions/13974479/deleting-versions-of-ruby

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!