Rails 4; asset helper not pointing to fingerprinted image asset (failure to load in production @ Heroku) Rails 4; asset helper not pointing to fingerprinted image asset (failure to load in production @ Heroku) heroku heroku

Rails 4; asset helper not pointing to fingerprinted image asset (failure to load in production @ Heroku)


For what it's worth, this happened to be AGAIN, and this time I could not use the hack because I desperately needed the fingerprint. So somehow, magically, I ran a rake assets:clobber and heroku run rake assets:clobber to clean all assets, and then a straight up git push to force Heroku to do the precompilation for me. That did it, and everything works.

Now, when this happens, I clobber assets locally & in production and push, forcing Heroku to precompile remotely. Similar to @user2880239's answer. I have stopped precompiling locally and checking into git.


I sat with a Sr Rails developer who still couldn't help me fix this. But the workaround we ended up using was that we just manually removed the asset fingerprint in the public folder (since the fingerpoint is what the asset helper is meant to point to).

I.e., the file galleria/classic-map-587854758918434124.png we just manually changed back to galleria/classic-map.png and it works fine.

Note that if you do this 'hack', the next time you precompile assets, Rails will create another fingerprinted asset, so you'll have duplication unless you want to keep deleting the additional fingerprinted asset each time. For me, I don't care about the duplication, I care about not thinking about this anymore.


Did you check RAILS_ENV ?

bundle exec rake assets:precompile RAILS_ENV=production