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

StackOverflow https://stackoverflow.com/questions/23629879

  •  21-07-2023
  •  | 
  •  

Question

I am getting the following error:

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

On this line:

  <%= stylesheet_link_tag "application", media: "all",

From this portion of my layouts file:

  <html>
    <head>
      <title><%= full_title(yield(:title)) %></title>
      <%= stylesheet_link_tag "application", media: "all",
                                             "data-turbolinks-track" => true %>
      <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
      <%= csrf_meta_tags %>

I have never encountered this problem before and the explanations online were either too advanced for me or were related to people making games, my project is a simple rails app that I just started yesterday.

Was it helpful?

Solution

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?

OTHER TIPS

Fix: change the secret key base to invalidate all sessions, especially after Rails upgrade.

I had to delete the sass and sprockets folders in rails_root/tmp/cache.

Well, I’ll put it here just in case.

I had the similar problem after power outage on my dev machine. Refined solutions, listed around (explicit assets clearing and even removal of tmp/cache folder,) did not work for me.

What worked, was a hammer blow:

rm -rf $RAILS_ROOT/tmp

Make sure that $RAILS_ROOT is defined before doing this, or you will delete your root /tmp directory

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top