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

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

问题描述

我有一些不会消失的红宝石.

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

我认为这与我安装它们的时间有关.有时我在执行 gem 安装之前忘记使用sudo",这会导致写入错误,并且我可以收集的内容将 gem 的副本放在我的用户目录中,而不是它可以运行的地方.但是 gem 卸载不起作用.它不断出现在宝石列表"中,但无法从 gem 卸载或 sudo gem 卸载中卸载它.在我的gem 环境"中找到路径后,我尝试直接删除一个 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

要删除系统上的所有 gem,只需删除此命令返回的文件夹即可.

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

此外,在 OSX Leopard 上,默认 gem 安装在此文件夹中:

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

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

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

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

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