When I put my website in production using git push heroku master
the url in my CSS does not refer to the right image url.
Here is my situation in development environment :
- app/assets/images/logo.png is present
- app/views/layouts/application.html.erb :
<%= stylesheet_link_tag "style" %>
- app/assets/stylesheets/style.css :
background: asset-url("logo.png");
Here is my situation in production (when I "View Page source") :
- I don't know how to find logo.png ?
- Link to my CSS :
<link href="/assets/style-75a5c3912777c4b39ba92d1893ac7815.css" media="screen" rel="stylesheet" />
- In my (compressed) CSS I can find :
background:asset-url("logo.png");
For the others images called directly from app/views/* it's ok (<%= link_to image_tag("xxx.png") %>
)
In config/environments/production.rb I have :
config.assets.precompile += ['style.css']
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
config.assets.digest = true
config.assets.compile = true
config.serve_static_assets = true
I'm following this great tutorial.