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 ?