Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

invalid gem: package is corrupt -- while installing rails in osx yosemite 10.10.1

I am getting this error while installing rails in osx yosemite 10.10.1

 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

Any Idea??

like image 761
Mezbah Avatar asked Dec 20 '22 00:12

Mezbah


1 Answers

I got my answer. I remove previous cache and then everything fine.

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
like image 108
Mezbah Avatar answered Apr 27 '23 01:04

Mezbah