无效的gem:包已损坏 - 在osx yosemite中安装rails 10.10.1

时间:2015-09-02 12:52:38

标签: ruby-on-rails ruby macos nokogiri

我在osx yosemite 10.10.1

中安装rails时遇到此错误
 mezbah$ gem install rails --no-ri --no-rdoc
    ERROR:  Error installing rails:
        invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/mezbah/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/cache/nokogiri-1.6.6.2.gem
 mezbah$ gem install nokogiri
       ERROR:  Error installing nokogiri:
            invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/mezbah/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/cache/nokogiri-1.6.6.2.gem

任何想法?

1 个答案:

答案 0 :(得分:10)

我得到了答案。我删除了以前的缓存,然后一切都很好。

sudo rm /Users/username/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/cache/nokogiri-1.6.6.2.gem

brew install libiconv   

gem install nokogiri