toamitkumar's Code Blog

Ruby, Rails, RubyMotion, Chef, Puppet, Play and others. Opinions expressed here are my own and do not reflect those of my employer.

Marshal Data Too Short - Rubygems Error

| Comments

Today while doing “bundle update” my server started to throw weird error.

Somehow I was not able to relate it to bundler and doing

# gem update
updating installed gems
ERROR: While executing gem … (ArgumentError)
marshal data too short

explained that gem specs on the server is corrupted. I still need to figure out the reason why that happened in first place.

This error kept popping up – no matter what commands I wanted to run with rubygems (update, update –system, install…)

Googling did not give any solution on this topic. I had a feeling it is messing with ~/.gems directory - and found out to be true.
I deleted all entries inside the ~/.gems directory. I had to just just reinstall all my gems.

Any better ways to solve this problem ?


found out specifically the dm-types.rz in the ~/.gems/specs folder was corrupt. wiped out the ~/.gems/specs folder and reran bundle install and it worked.
I'm having the same problem. what does your Gemfile look like?