摆脱不会死亡的红宝石宝石 [英] getting rid of ruby gems that won't die

查看:82
本文介绍了摆脱不会死亡的红宝石宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几颗不会消失的红宝石宝石。

I've got a few ruby gems that won't go away.

我认为这与我安装它们时有关。有时候我忘了在进行gem安装之前使用sudo,这会导致写入错误,并且从我可以收集的内容中将gem的副本放在我的用户目录中,而不是它可以运行的某个位置。但宝石卸载不起作用。它不断地显示在宝石列表中,但不能从卸载宝石或卸载sudo卸载它。我试图在我的'gem环境'中找到路径后直接删除一个gem,但是仍然留下了列表中的宝石。

I think it has to do with when I installed them. Occasionally I have forgotten to use "sudo" before doing a gem install, which results in a write error and from what I can gather puts a copy of the gem in my user directory instead of somewhere it can run. But gem uninstall doesn't work. It continually shows up in 'gem list' but can't uninstall it from either gem uninstall, or sudo gem uninstall. I tried directly deleting one gem after finding the path in my 'gem environment', but that still left the gem on the list.

也可以只删除所有宝石,并从头开始?这些让我疯狂。

Also is it possible just to remove all gems and start from scratch? These are driving me nuts.

我正在运行OS X。

I'm running OS X.

推荐答案

假设 gem clean (或 sudo gem clean )不起作用,我会尝试以下操作完全删除系统中的所有宝石:

Assuming that gem clean (or sudo gem clean) doesn't work, I would try the following to totally remove all gems from your system:

您可以通过运行以下命令来查看安装了gem的位置:

You can see where gems have been installed by running the command:

gem env paths

删除系统上的所有宝石,只需删除此命令返回的文件夹。

To remove all the gems on your system, simply remove the folders returned by this command.

另外,在OSX Leopard上,默认的宝石安装在此文件夹中:

Additionally, on OSX Leopard, default gems are installed in this folder:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

如果您的系统上存在此文件夹,您可以像以前一样删除此文件夹以确保删除所有宝石。

If this folder exists on your system, as before you can remove this folder to ensure all gems are deleted.

这篇关于摆脱不会死亡的红宝石宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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