Error: While Executing Gem ... (Typeerror) Incompatible Marshal File Format (Can't Be Read)

ERROR: While executing gem ... (TypeError) incompatible marshal file format (can't be read)

Thanks to Morgan Jarry answer, this is what worked for me :

I checked my current sources and indeed they were outdated :

gem sources

It printed

*** CURRENT SOURCES ***
http://gems.rubyforge.org/
http://gems.github.com

So I ran this script to remove them and replaced them with https://rubygems.org/

gem sources -r  http://gems.rubyforge.org/
gem sources -r http://gems.github.com
gem sources -a https://rubygems.org/

incompatible marshal file format (can't be read) format version 4.8 required; 0.0 given

Have you tried clearing assets?
bundle exec rake assets:clean

And then recompile:
bundle exec rake assets:precompile

Are you somehow mixing up Ruby versions? Maybe you are precompiling with 1.9 and running Rails through Passenger or something with 2.0?

How to install ruby gem without sudo?

You have only enable very old (and not maintained) remote gem sources in your gem configuration. This might be caused by some old migrated configuration or by following some very old and outdated advice.

To fix this, you first need to remove the outdated gem sources and then add the only one which should be currently used. For that, you can run the following command from your Terminal:

gem sources --remove http://gems.github.com/
gem sources --remove http://gems.rubyforge.org/

gem sources --add https://rubygems.org/


Related Topics



Leave a reply



Submit