puma: Puma says "Address already in use"
I read through a long thread of issue #73 and #193 hoping to find a solution. It seems as though it was addressed for some people with some previous releases, but I’m having the problem again. Just wanted to put this out there and see if anyone else is still having this problem.
This is what I get when I run ‘foreman start’ from my app root.
22:01:58 web.1 | started with pid 33702
22:01:59 web.1 | [33702] Puma starting in cluster mode...
22:01:59 web.1 | [33702] * Version 2.8.1 (ruby 2.1.0-p0), codename: Sir Edmund Percival Hillary
22:01:59 web.1 | [33702] * Min threads: 1, max threads: 16
22:01:59 web.1 | [33702] * Environment: development
22:01:59 web.1 | [33702] * Process workers: 3
22:01:59 web.1 | [33702] * Preloading application
22:02:01 web.1 | [33702] * Listening on tcp://0.0.0.0:5000
22:02:01 web.1 | /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/binder.rb:195:in `initialize': Address already in use - bind(2) for "0.0.0.0" port 5000 (Errno::EADDRINUSE)
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/binder.rb:195:in `new'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/binder.rb:195:in `add_tcp_listener'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/binder.rb:96:in `block in parse'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/binder.rb:82:in `each'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/binder.rb:82:in `parse'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/runner.rb:119:in `load_and_bind'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/cluster.rb:275:in `run'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/lib/puma/cli.rb:506:in `run'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/gems/puma-2.8.1/bin/puma:10:in `<top (required)>'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/bin/puma:23:in `load'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/bin/puma:23:in `<main>'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
22:02:01 web.1 | from /Users/eli/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
22:02:01 web.1 | exited with code 1
22:02:01 system | sending SIGTERM to all processes
SIGTERM received
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 24 (5 by maintainers)
This is happening for me when I control c to quit foreman. I then have to use
lsof -i :5000
andsudo kill -9 <pid>
to kill the process if I want to run foreman again.This code will automate the process of fixing it for you https://github.com/pailoro/rails_server_killer
For anyone that has issues with Port 5000
https://developer.apple.com/forums/thread/682332
This still happens sometimes. Still can’t figure out what conditions cause it though.