干净安装OSX 10.9.1返回“未定义的方法`path2class”"当试图安装宝石 [英] Clean install OSX 10.9.1 returns "undefined method `path2class'" when trying to install gems

查看:76
本文介绍了干净安装OSX 10.9.1返回“未定义的方法`path2class”"当试图安装宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚用Homebrew和RVM安装了一个干净的Mavericks安装。既然 brew doctor rvm requirements returnall good,但是当我运行 bundle在我的项目目录中安装大多数我的宝石安装正常,但少数安装失败,出现以下相同错误:

  Bundler :: GemspecError:无法读取/Users/NK/.rvm/gems/ruby-2.0.0-p353/cache/eventmachine-1.0.3.gem中的gem。它可能已损坏。 
安装eventmachine(1.0.3)时发生错误,并且Bundler无法继续。
确保`gem install eventmachine -v'1.0.3'`捆绑成功。

然后,如果我再次尝试 gem install eventmachine -v'1.0。 3'我得到:

 错误:安装eventmachine时出错:
无效gem:package在验证时出现异常:未定义的方法`path2class'为#< Psych :: ClassLoader:0x000001018f7990> (NoMethodError)in /Users/NK/.rvm/gems/ruby-2.0.0-p353/cache/eventmachine-1.0.3.gem

我试图破解RVM并重新安装,但没有任何帮助。

其他人似乎也有同样的问题,但似乎没有人有资金的答案呢:



编辑



请看这两个:




解决方案

事实证明,这是一个老版本的心灵中的错误,但它不能解决,只要你用RVMs静态链接的宝石安装ruby。所以基本上这个问题与RVMs静态链接的gem有关。使用 - disable-binary 来安装rubies可以解决这个问题:

  rvm install 2.0.0-p353 --disable-binary 

或者重新安装:

  rvm重新安装2.0.0-p353 --disable-binary 


I just installed a clean Mavericks installation with Homebrew and RVM. Both brew doctor and rvm requirements return "all good", however, when I run bundle install in my project dir most of my gems install fine, but a handful fail to install with the same following error:

Bundler::GemspecError: Could not read gem at /Users/NK/.rvm/gems/ruby-2.0.0-p353/cache/eventmachine-1.0.3.gem. It may be corrupted.
An error occurred while installing eventmachine (1.0.3), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.0.3'` succeeds before bundling.

Then, if I try again with gem install eventmachine -v '1.0.3' I get:

ERROR:  Error installing eventmachine:
    invalid gem: package is corrupt, exception while verifying: undefined method `path2class' for #<Psych::ClassLoader:0x000001018f7990> (NoMethodError) in /Users/NK/.rvm/gems/ruby-2.0.0-p353/cache/eventmachine-1.0.3.gem

I tried to implode RVM and reinstall, but nothing helps.

Other people seem to have the same problem, but no one seems to have fund the answer yet:

EDIT

See those two as well:

解决方案

It turns out that this is a bug in an older version of psych, but it can't be solved, as long as you installed ruby with RVMs statically linked gems. So basically the problem is related to RVMs statically linked gems. Installing rubies with the --disable-binary solves the problem:

rvm install 2.0.0-p353 --disable-binary

Or reinstall with:

rvm reinstall 2.0.0-p353 --disable-binary

这篇关于干净安装OSX 10.9.1返回“未定义的方法`path2class”&quot;当试图安装宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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