I've been running a Rails 3.1 app on Heroku Cedar Stack for a couple of months now. I'm using Rack::Deflater middleware to gzip my content and achieve this by
config.middleware.insert_before ActionDispatch::Static, Rack::Deflater
in my staging.rb file.
However, since last week, I get the following error when deploying to Heroku
Running: rake assets:precompile
rake aborted!
No such middleware to insert before: ActionDispatch::Static
However, running rake middleware still returns
use Rack::Cache
use Rack::Deflater
use ActionDispatch::Static
use Rack::Lock
And content served were still gzipped. However, assets were not compiled(minified) as pre-compilation failed. A manual rake precompile::asets also does not help.
So, I'm assuming ActionDispatch::Static is not available during pre-compilation of assets. So I tried to insert Rack::Deflater before Rack::Lock and now my assets are compiled without any error message but content served is not gzipped.
So, what do I need to do, to both gzip and compile my assets? What am I missing? Thanks.