安装rubyracer时出错,错误“gem gem:package is corrupt”

时间:2014-01-02 17:29:25

标签: ruby gem

尝试在OSX 10.9上安装therubyracer时,使用以下命令:

$ gem install therubyracer -v '0.12.0'

我收到错误:

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

安装了XCode开发人员工具,我尝试删除缓存文件,但仍然收到错误。

2 个答案:

答案 0 :(得分:27)

删除/Users/doved/.rvm/gems/ruby-2.0.0-p353/cache/therubyracer-0.12.0.gem并再次安装gem。 RubyGems没有正确下载文件,系统正确报告gem已损坏。

答案 1 :(得分:0)

我遇到了以下问题:

"Conversation" should {
"Notify interlocutors when a talker is typing" in {
  val talkerRef1 = system.actorOf(Props())
  val talkerRef2 = system.actorOf(Props())

  val talkerRef1Id = TalkerIdStub.random

  val conversationId = UUID.randomUUID()

  val conversationRef = system.actorOf(Props(classOf[Conversation], conversationId, List(talkerRef1, talkerRef2)))

  // should I use TestActorRef ?

  conversationRef ! InterlocutorTyping(talkerRef1Id)

  // assert that talker2 is notified when talker1 is typing
}
}

然后要修复此问题,我必须转到以下目录: Bundler::GemspecError: Could not read gem at /home/username/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/cache/nokogiri-1.6.6.3.gem. It may be corrupted.

然后我删除了损坏的宝石,即我的情况下的Nakogiri。

然后我运行以下命令: /home/username/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/cache

再次安装宝石后,我很高兴。