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
Rails: Url/Path with Parameters
Convert Hash to Openstruct Recursively
Rbenv: Ruby: Command Not Found
Run Code Only If Script Called from the Command Line
Including a Virtual Attribute in the Respond_With Hash
Iterate an Array, N Items at a Time
Ruby - Array.Join Versus String Concatenation (Efficiency)
Are There Ruby Equivalents to Car, Cdr, and Cons
Installing Native Ruby Extensions on Windows for Jekyll
Adding Username to Devise Rails 4
Decoding Facebook's Signed Request in Ruby/Sinatra
How to Do a Left Outer Join Using Rails Activerecord
Using Will_Paginate Without :Total_Entries to Improve a Lengthy Query
How to Allow Binary File Download Using Grape API
Is It a Bad Idea to Reload Routes Dynamically in Rails
Active Admin: Sorting on Multiple Columns
Differences Between Literals and Constructors? ([] VS Array.New and {} VS Hash.New)