如何从/usr/local 卸载 Ruby? [英] How to uninstall Ruby from /usr/local?

查看:24
本文介绍了如何从/usr/local 卸载 Ruby?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一切都很好,直到我们决定将 ruby​​ 从 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.

当我们尝试which ruby​​"时,它指向/usr/local.如果有人能帮助我们解决我们需要做的事情,让我们重回正轨,我们将不胜感激.也知道如何从/usr/local 卸载 ruby​​.我们尝试了 yum remove 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 !

推荐答案

如果 1.8.6 位于 /usr/bin 中,则卸载它不是一个好主意.它归操作系统所有,预计会在那里.

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/local/bin 放在 /usr/bin 之前的 PATH 中,那么你已经安装在 /usr/local/bin 将在 /usr/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屋!

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