Skip to content

Instantly share code, notes, and snippets.

@aniarya82
Created August 8, 2015 22:13
Show Gist options
  • Save aniarya82/fb665ed8382141a7c9fb to your computer and use it in GitHub Desktop.
Save aniarya82/fb665ed8382141a7c9fb to your computer and use it in GitHub Desktop.
MhiBtenA:prep hiten$ gem install nokogiri
ERROR: Error installing nokogiri:
invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/hiten/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/cache/nokogiri-1.6.6.2.gem
This error was one heck of a thing.
Seems that when you run `gem install nokogiri` for very first time gem fetches the gem file `nokogiri-[version].gem` and stores it in the gem cache.
Here was the error taking place, maybe the gem was corrupte in someway or some glitch occured during fetching the gem fill which caused the error.
And everytime you would run`gem install nokogiri' it will see that already gem file exists in the cache and hence doesn't fetch again, but the gem file was corrupt so the repeatedly kept on.
Finally i manually removed the gem file with `rm /path/to/gem/file.gem` and the again ran `gem install nokogiri` and this time it again fetch form api.rubygems.org.
And after fetch over Vola the gem was successfully installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment