rails: rails restart doesn't work with puma3
Steps to reproduce
rails new foo
cd foo
rails server
rails restart
Expected behavior
Server should restart.
Actual behavior
Puma notices the change to tmp/restart.txt
, stops the server, and attempts to restart the server with its own ideas of what ARGV should look like. Rails doesn’t like what it sees in ARGV, and spits out usage instructions. At that point, the server is down.
The problem also occurs with rails dev:cache
.
System configuration
Rails version: Rails 5.0.0.beta3 (master
)
Ruby version: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 21 (21 by maintainers)
hey @sikachu @rubys try this https://github.com/chashmeetsingh/rails/blob/master/railties/lib/rails/tasks/restart.rake I got it working boohoo Still needs improvements
I made some progress on this.
We need to provide a restart command to Puma which it will use while restarting the server. The command will be
bin/rails s
.Even after this, there is an issue with existing
pid
file present intmp/pids/server.pid
file. I think it’s okey to remove that file manually from Rails side when doingrails restart
orrails dev:cache
. But would like to hear more opinions if I am missing something. (cc @rafaelfranca, @kaspth )I think we will need to make some changes to Puma also to correctly accept the restart command from Rails. I got it working locally and will make a PR shortly to Puma.
`def restart! @config.run_hooks :on_restart, self
I did this still get the same error as rubys 😦
From the messages, it appears that the port is being inherited.
More generally:
I’ve opened a separate issue to track the puma changes required: https://github.com/puma/puma/issues/907