https://gist.github.com/steakknife/b318a570803b08c1548c7f51c18c0753
Dual-licensed: MIT or DWFTYL
Listenfires up afsevent_watchfor every directory watched- Puma is a threaded server, restarting it doesn't restart the Ruby process
- The development server + spring uses
Listento hot-reload code (models, views, controllers, etc.) - Restarting the server doesn't call
#stopon theListeninstances - Tons and tons of
fsevent_watchappear untilfork()fails
- Call
#stopon allListeninstances (including yours), to kill off unneededfsevent_watch
- Add all the other files included in this gist as per their names
- Add this to your
config/puma.rb
# config/puma.rb
#...
# FSEvent cleanup -- begin
# let puma find custom, project-included puma plugins
lib = File.expand_path('lib')
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include(lib)
# kill off fsevent_watch in development
plugin :fsevent_cleanup
# FSEvent cleanup -- endNotes
- Works with MRI
- Won't work with JRuby unless ObjectSpace is enabled
- Might not work on Rubinius
- Don't use
bin/rails susebin/bundle exec pumabecause Rails + Puma +rails cis broken (both try to writetmp/pids/server.pid, rails doesn't like threaded servers restarting themselves)