I just installed a clean Mavericks installation with Homebrew and RVM. Both brew doctor
and rvm requirements
return "all good", however, when I run bundle install
in my project dir most of my gems install fine, but a handful fail to install with the same following error:
Bundler::GemspecError: Could not read gem at /Users/NK/.rvm/gems/ruby-2.0.0-p353/cache/eventmachine-1.0.3.gem. It may be corrupted.
An error occurred while installing eventmachine (1.0.3), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.0.3'` succeeds before bundling.
Then, if I try again with gem install eventmachine -v '1.0.3'
I get:
ERROR: Error installing eventmachine:
invalid gem: package is corrupt, exception while verifying: undefined method `path2class' for #<Psych::ClassLoader:0x000001018f7990> (NoMethodError) in /Users/NK/.rvm/gems/ruby-2.0.0-p353/cache/eventmachine-1.0.3.gem
I tried to implode RVM and reinstall, but nothing helps.
Other people seem to have the same problem, but no one seems to have fund the answer yet:
EDIT
See those two as well:
It turns out that this is a bug in an older version of psych, but it can't be solved, as long as you installed ruby with RVMs statically linked gems. So basically the problem is related to RVMs statically linked gems. Installing rubies with the --disable-binary
solves the problem:
rvm install 2.0.0-p353 --disable-binary
Or reinstall with:
rvm reinstall 2.0.0-p353 --disable-binary
I had the very same error and looked into the psych gem
$ gem list --local | grep psych
psych (2.0.4, 2.0.0)
as version 2.0.4 was recently installed I removed it, keeping only version 2.0.0
$ gem uninstall psych -v '2.0.4'
Successfully uninstalled psych-2.0.4
After that, everything worked fine again!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With