如何从/usr/local卸载Ruby? [英] How to uninstall Ruby from /usr/local?
问题描述
一切正常,直到我们决定将红宝石从1.8.6升级到1.8.7,然后一切都崩溃了.当我们从源代码编译Ruby 1.8.7时,它已安装在/usr/local/bin中,而Ruby 1.8.6则保留在/usr/bin中. 当前,我们已经卸载了ruby 1.8.6,并通过一些操作从/usr/local中删除了ruby 1.8.7文件.
Everything was working fine , until we decided to upgrade ruby to 1.8.7 from 1.8.6, and thats when all hell broke loose. When we compiled Ruby 1.8.7 from source it got installed into /usr/local/bin and Ruby 1.8.6 stayed in /usr/bin. Currently, we've uninstalled ruby 1.8.6 and by some stroke we deleted the ruby 1.8.7 files from /usr/local.
当我们尝试哪个红宝石"时,它指向/usr/local. 如果有人可以帮助我们完成我们需要做的事情,我们将不胜感激.并且也知道如何从/usr/local卸载ruby. 我们尝试了yum删除ruby,它从/usr/bin中删除了ruby.谢谢,干杯!
when we try "which ruby" it points to /usr/local. If anybody could help us out what we need to do get back on track , we would be very grateful.and also any idea how we can uninstall ruby from /usr/local. we tried yum remove ruby , which removed ruby from /usr/bin.Thanks and Cheers !
推荐答案
如果/usr/bin
中已安装1.8.6,则不是一个好主意.该文件归操作系统所有,并且有望在该目录中存在.
It's not a good idea to uninstall 1.8.6 if it's in /usr/bin
. That is owned by the OS and is expected to be there.
如果在/usr/bin
之前的路径中将/usr/local/bin
放在PATH中,则将在/usr/bin
中找到所有安装在/usr/local/bin
中的东西,从而有效地覆盖或更新它们,而实际上并没有这样做.您仍然可以通过在#中显式使用/usr/bin
来到达它们!代码顶部的解释器调用行.
If you put /usr/local/bin
in your PATH before /usr/bin
then things you have installed in /usr/local/bin
will be found before any with the same name in /usr/bin
, effectively overwriting or updating them, without actually doing so. You can still reach them by explicitly using /usr/bin
in your #! interpreter invocation line at the top of your code.
@Anurag建议使用RVM,我将其次.除了操作系统1.8.6之外,我还用它来管理1.8.7和1.9.1.
@Anurag recommended using RVM, which I'll second. I use it to manage 1.8.7 and 1.9.1 in addition to the OS's 1.8.6.
这篇关于如何从/usr/local卸载Ruby?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!