Rails Asset - NoMethodError `dependency_digest`
Asked Answered
K

2

7

Seemingly out of nowhere a rails project has broken for me on my local machine. The same codebase is working on production though, interestingly enough.

As soon as any asset tries to load I get the following error:

undefined method `dependency_digest' for #<Sprockets::StaticAsset:0x007fefb93d0d28>

The error appears even as the site tries to load the stylesheet_link_tag, but it seems to be happening for all assets.

Inasmuch as I can tell, I've made no changes to incite this error. In fact, the local server was working (both with pow and webrick) and then, just stopped. After no changes.

I've tried reverting the history back through my commits, but with absolutely no luck.

Any ideas?

Korrie answered 5/4, 2014 at 8:36 Comment(4)
Same here, no idea either. Did you fix it?Oleson
I was only able to fix it by essentially reinstalling the whole app. I have everything on github, which makes it easier, but for the sake of the files I've got placed on .gitignore I made a backup of my directory, deleted the directory, cloned everything again from github, and over. Lost my local db but seeding made that alright.Korrie
This happened to me after installing github.com/pitr/angular-rails-templates (which worked initially). No other changes... Rails 4.1Brno
I'm seeing this error when using jwhitley's requirejs-rails gem in Rails 4.1 and SlexAxton's require-handlebars-plugin for rendering Handlebars templates, and a template is using a Handlebars helper that's not defined. In appears in my dev environment, when requirejs tries to fetch the template with a missing helper, it gets a 404 with this error from Rails.Weed
G
11

This should solve it.

rake tmp:cache:clear

Gooseneck answered 4/6, 2014 at 19:1 Comment(2)
I never ended up needing to do this but after some more research I do believe this is the correct answer and I will accept it as such.Korrie
I had deep respect for Rails, but it's quickly degrading as I am stumbling upon issues like these, fixed in the most stupid way possible; seriously, clearing assets cache? Wow.Claycomb
S
0

On Heroku, I ran into this problem after switching around some buildpacks. The accepted answer on this SO post did NOT fix my problem (rake tmp:cache:clear) although it may have fixed other people's problems, the only way I could fix this was using:

heroku repo:purge_cache -a appname

see https://github.com/heroku/heroku-repo for documentation on the heroku repo plug-in

Scouring answered 7/3, 2017 at 15:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.