0

I'm running a rails app which serves some small images statically (like the site logo and background texture). I'm storing these images in /public/images/. Everything has been working fine until recently, but now suddenly the server is responding with a 404 for these image requests.

The images are stored in the right place, and the front-end is requesting the right thing (e.g. http://localhost:3000/images/logo.png), but still the 404. I also have set config.serve_static_assets = true in development.rb and tried rake assets:clean and rake assets:clobber, and deleted the contents of /tmp/cache/. I think the problem is linked to me running rake assets:precompile locally, but I'm unsure of the exact reason/solution.

Interestingly, although all image requests return a 404, requests to images which actually exist get a 404 with a message displayed to the user ("File not found: /Users/user/Documents/app name/public/images/logo.png"), whereas requests for images that genuinely don't exist like /images/foobar.png just return a routing error.

Bez_almighty
  • 105
  • 10

1 Answers1

0

Try with including it you gem file if you don't have it before. Thanks

gem "non-stupid-digest-assets"
Prakash Laxkar
  • 824
  • 1
  • 8
  • 17