Rails 4 assets not found in production (digest path is OK) Rails 4 assets not found in production (digest path is OK) ruby-on-rails ruby-on-rails

Rails 4 assets not found in production (digest path is OK)


You might be having the same problem as described here: No route matches [GET] /assets

Basically, if you're using rails server to test your app, your precompiled assets wont be served up by default. Rails expects the web server (apache, nginx, etc) to serve them up. You need to make a change to config/environments/production.rb and set serve_static_assets to true.


I got a similar issue to yours.

Here's my solution for image_tag links: use image_tag asset_path() instead of image_tag '/pic.ext' like this:

<%= image_tag asset_path("combat_elephant.png") %><%= link_to (image_tag asset_path("puskay_pivka_zahvatyat.png")), "/path" %>

Also I'm using nginx for serving static assets, so I have config.serve_static_assets = false and config.assets.compile = true

hope that helps