Different behaviors for same rack stack in development and production environment

Hello !

I had to deploy a rails 3 app on heroku
app is using bare sass, and it is already known as a hassle (
so I looked for what was said on web, and decided to offer serve sassed
from tmp dir, using Rack::Static, as first option (considering another
at the same time)

First try was to drop in config/initializers/sass.rb

Sass::Plugin.options[:css_location] = ‘tmp/stylesheets’
Rails::Application.middleware.use Rack::Static, :root => ‘tmp’, :urls =>

It works on development env, generating tmp/stylesheets/base.css then
it up
On production, what I saw was :

  • server runs for 30s
  • client receive empty base.css
    ouch!, ugly rendering!

So same rack stack produced different behaviors on development and

moving Rack::Static from initializer to top of config.ru produce
behavior on both env
I retained this one now

Does someone has a clue on why #1 produce different behaviors in
and production ?
Curious, Thierry