No such middleware to insert before: ActionDispatch::Static
Closed this issue · 6 comments
When I try to compile my javascripts and stylesheets on production with RAILS_ENV=production bundle exec rake assets:precompile
command, why I got this error when using Lines-Engine on my project :
No such middleware to insert before: ActionDispatch::Static
/.../config/environment.rb:5:in <top (required)>
/.../.rbenv/versions/2.3.3/bin/bundle:22:in load
/.../.rbenv/versions/2.3.3/bin/bundle:22:in <main>
Tasks: TOP => environment
(See full trace by running task with --trace)
I am using Rails 4.2.7 with Ruby 2.3.3. Thank you
getting this on Rails 5.1.4 also, but only in production mode, running passenger
Message from application: No such middleware to insert before: ActionDispatch::Static (RuntimeError)
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/stack.rb:106:in `assert_index'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/actionpack-5.1.4/lib/action_dispatch/middleware/stack.rb:73:in `insert'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/configuration.rb:69:in `block in merge_into'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/configuration.rb:68:in `each'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/configuration.rb:68:in `merge_into'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:507:in `block in app'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:504:in `synchronize'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/engine.rb:504:in `app'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/application/finisher.rb:45:in `block in <module:Finisher>'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
/Users/scott/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
Added PR #17
use
gem 'lines-engine', github: "scottbarrow/lines-engine", branch: "fix_middleware_insert_production"
in the meantime
Thank you for the quick fix @scottbarrow
A new version (1.2.3) with your fix is released
Thanks for the quick turnaround @thej
I have rails 6 and this is the error i get when i try to bundle
Bundler could not find compatible versions for gem "rails": In Gemfile: rails (~> 6.0.2.2)
lines-engine (~> 1.2, >= 1.2.6.1) was resolved to 1.2.6.1, which depends on rails (< 6, >= 3)
I added this gem and it was fixed gem 'rails_12factor'