Mac OS X上未初始化的常量Gem :: UserInteraction(NameError) [英] uninitialized constant Gem::UserInteraction (NameError) on Mac OS X

查看:56
本文介绍了Mac OS X上未初始化的常量Gem :: UserInteraction(NameError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图在Mac OS X上运行grunt但是,每当我运行它时,它总是给我这个错误.实际上,每当我尝试做任何与红宝石有关的事情时,它都会给我这个错误,甚至像宝石-v

So I am trying to run grunt on Mac OS X However, whenever I run it, it always gives me this error. In fact, whenever I try to do anything involving ruby, it gives me this error, even something like gem -v

我检查了一下google,他们说要在/usr/bin/gems中包含一行,但是我发现它已经包含在第9行中了

I checked around google and they said to include a line in /usr/bin/gems but I found that it was already included on line 9

  8 require 'rubygems'
  9 require 'rubygems/gem_runner'
 10 require 'rubygems/exceptions'

它指向我的媒体库目录中的config.rb文件,尤其是在此行:

it points to a config.rb file in my Library directory, at this line in particular:

 39   include Gem::UserInteraction

可以采取什么措施来消除此错误?

what can be done to get rid of this error?

推荐答案

我不确定是什么原因,但是我认为最近的gem更新对我来说是无效的(因为某些rubygems版本附带了问题: https://github.com/rubygems/rubygems/blob/master/UPGRADING.rdoc ).似乎rubygems中的config_file被弄乱了,不能包含UserInteraction gem.

I am not entirely sure what the cause is, but I think a recent gem update broke it for me (since some rubygems versions shipped with issues: https://github.com/rubygems/rubygems/blob/master/UPGRADING.rdoc). It seems that the config_file in rubygems is messed up, and can't include UserInteraction gem.

对我来说,修复此问题的方法是从 http://ruby​​gems手动下载并安装最新的rubygems(v2.1.11)..org/pages/download .试一试,或许也能解决您的问题,而我们正在等待有人解释根本原因.

What fixed it for me was manually downloading and installing the latest rubygems (v2.1.11) from http://rubygems.org/pages/download. Give it a try, might fix your issue as well, while we wait for someone to explain the root cause.

这篇关于Mac OS X上未初始化的常量Gem :: UserInteraction(NameError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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