Heroku Open “Puma Port 5000 Already In Use” Rails

2019-07-14 17:56发布

问题:

When I Control-C to quit "Heroku Open" (the Heroku Toolbar server command). I'm unable to restart. I receive this error:

/vendor/bundle/gems/puma-2.14.0/lib/puma/binder.rb:233:in `initialize': Address already in use - bind(2) for "0.0.0.0" port 5000 (Errno::EADDRINUSE)
web.1  | s/vendor/bundle/gems/puma-2.14.0/lib/puma/cluster.rb:304:in `run'

Is their a "correct" way to shut down the Heroku Toolbar local rails server in order to avoid this problem?

回答1:

The only method I've used that works to resolve this problem is to run lsof to identify what is using port :5000 and then sudo kill on the pid(s) that are accessing that port.

lsof -i :5000 
sudo kill -9 <pid>


标签: port puma