Restart Puma when some files change
Add this line to your application's Gemfile:
gem 'guard-puma'
And then execute:
$ bundle
Or install it yourself as:
$ gem install guard-puma
guard init puma or add the following manually to your Guardfile
guard 'puma', :port => 4000 do
watch('Gemfile.lock')
watch(%r{^config|lib/.*})
endRun guard-puma with bundle exec guard.
Note that if you're running guard-puma in Docker, you'll additionally need to pass the -i argument to your command in order to disable all terminal interactions, for example:
CMD ["bundle", "exec", "guard", "-i"]
:portis the port number to run on (default4000):environmentis the environment to use (defaultdevelopment):start_on_startwill start the server when starting Guard and stop the server when reloading/stopping Guard (defaulttrue):force_runkills any process that's holding open the listen port before attempting to (re)start Puma (defaultfalse).:daemonruns the server as a daemon, without any output to the terminal that ranguard(defaultfalse).:quietruns the server in quiet mode, suppressing output (defaulttrue).:debuggerruns the server with the debugger enabled (defaultfalse). Required ruby-debug gem.:timeoutwaits this number of seconds when restarting the Puma server before reporting there's a problem (default20).:restart_timeoutwaits this number of seconds before the next restarting the Puma server (default1).:configis the path to the Puma config file (optional):bindis URI to bind to (tcp:// and unix:// only) (optional):control_tokenis the token to use as authentication for the control server(optional):control_portis the port to use for the control server(optional):threadsis the min:max number of threads to use. Defaults to 0:16 (optional):pumactlmanages the server viapumactlexecutable instead ofpuma(defaultfalse)- Incompatible with options such as
port,environment,daemon,bind,threads - Use with
configoption is preferred.
- Incompatible with options such as
:notificationsis the list of notification types that will be sent. Defaults to[:restarting, :restarted, :not_restarted, :stopped](optional)
- Fork it
mise install- Create your feature branch (
git checkout -b my-new-feature) - Leave the version alone!
- Add what you changed to CHANGES.md
- Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
- Update changelog
- Bump version in
lib/guard/puma/version.rb - Commit
mise release
