Linking failure in stylesheet_link_tag in production mode with asset pipeline enabled

Hey,

in my application.html.erb, I have this line:

<%= stylesheet_link_tag 'application' %>

which should compile through the asset pipeline and link to the
application.css (which does a require_tree .). In development mode,
I’d expect a

<link ... href="/assets/application.css" />

This file is actually delivered by, for example, the thin webserver.

When starting thin in production mode (even after rake assets:precompile), the application.css is still link’ed here I’d
expect the /assets/application-md5hash.css which is generated in the
public directory. Even further: in the SCSS files, the image_url
helper does not resolve the correct paths (cp.
http://rdoc.info/gems/sass-rails/3.1.0/Sass/Rails/Helpers),

background: image_url(‘foo.png’);

compiles to

background: url(/assets/foo.png);

instead of

background: url(/assets/foo-md5hash.png);

Or am I just missing something!?

Dominik

Got it.

In my config/enviroments/production.rb, the following lines were
missing:

config.assets.compress = true
config.assets.compile  = true
config.assets.digest   = true

I actually was upgrading a 3.0 application and obviously missed some
configs. Sorry for the noise!

(coincidentally, today’s Railscast covers this issue
#282 Upgrading to Rails 3.1 - RailsCasts)

Dominik