chriseppstein/compass — Issue #683: rails 3.2.0. No such middleware to insert before: "Rack::Sendfile"
Author: ndemoreau
Created: 2012-01-24 10:03:42+00:00
State: open

When upgrading to rails 3.2.0 and restarting Webrick, I get the error:

/Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/middleware/stack.rb:119:in `assert_index': No such middleware to insert before: "Rack::Sendfile" (RuntimeError)
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/middleware/stack.rb:83:in `insert'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/configuration.rb:38:in `block in merge_into'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/configuration.rb:37:in `each'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/configuration.rb:37:in `merge_into'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/engine.rb:469:in `app'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/finisher.rb:32:in `block in '
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `each'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/nico/Dropbox/iview/sites/masterproj/config/environment.rb:5:in `'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
from /Users/nico/Dropbox/iview/sites/masterproj/config.ru:4:in `block in

'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
from /Users/nico/Dropbox/iview/sites/masterproj/config.ru:1:in `new'
from /Users/nico/Dropbox/iview/sites/masterproj/config.ru:1:in `

'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands/server.rb:46:in `app'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands/server.rb:70:in `start'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands.rb:55:in `block in '
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands.rb:50:in `tap'
from /Users/nico/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/commands.rb:50:in `'
from script/rails:6:in `require'
from script/rails:6:in `

'

It seems that this problems comes from the initializer compass.rb where I added the lines:

Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static',
:urls => ['/stylesheets'],
:root => "#{Rails.root}/tmp")

Can I safely remove this?

Thanks,