johnbintz/rack-livereload

No such middleware to insert before: Rack::Lock (RuntimeError)

Opened this issue · 1 comments

I just upgraded to Rails 5, and I get this error:

=> Booting WEBrick
=> Rails 5.0.1 application starting in development on http://0.0.0.0:3001
=> Run `rails server -h` for more startup options
Exiting
/Users/josh/.rvm/gems/ruby-2.2.5@base/gems/actionpack-5.0.1/lib/action_dispatch/middleware/stack.rb:108:in `assert_index': No such middleware to insert before: Rack::Lock (RuntimeError)
	from /Users/josh/.rvm/gems/ruby-2.2.5@base/gems/actionpack-5.0.1/lib/action_dispatch/middleware/stack.rb:73:in `insert'

It's because I use better_errors gem. I have changed my config from

  config.middleware.insert_before Rack::Lock, Rack::LiveReload, no_swf:           true,
                                                                live_reload_port: 35729

to

  config.middleware.insert_before ActionDispatch::DebugExceptions, Rack::LiveReload, no_swf:           true,
                                                                                     live_reload_port: 35729

which seems to work.

In rack-livereload's README you still state to use Rack::Lock, maybe you should update it:

https://github.com/johnbintz/rack-livereload#readme

+1. It would be great if the README could be updated for Rails 5.