Bundler no metadata found problem
28 Sep 2010
On installing bundler, and getting into Rails 3.0.0, I began to get the following error when running bundle install:
/Library/Ruby/Site/1.8/rubygems/package/tar_input.rb:113:in `initialize': No metadata found! (Gem::Package::FormatError)
There are sporadic posts about this, but the one that solved the problem for me was the second comment on this issue:
I tracked this down to a corrupt .gem file in rubygems/cache folder. I submitted a patch to the rubygems team to provide better diagnostic output message which identifies the offending file. It still doesn’t address the root cause, but should help people find the problem faster.
At line 111 in /rubygems/package/tar_input.rb, change to:
unless has_meta
puts "#{io.path} may be corrupt! Delete it and retry the operation"
raise Gem::Package::FormatError, "No metadata found!"
end
The problem (im my case) was caused by a corrupt .gem file. Adding those lines to tar_input will give you a more meaningful error message, and allow you to delete the offending gem files.