6

Rails and Address Already In Use - Bind Error

 3 years ago
source link: https://fuzzyblog.io/blog/rails/2017/07/29/rails-and-address-already-in-use-bind-error.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Rails and Address Already In Use - Bind Error

Jul 29, 2017

Lately I've seen this error come up quite a few times:

/Users/sjohnson/.rvm/gems/ruby-2.3.1@seira_watch_web_app_api/gems/puma-3.9.1/lib/puma/binder.rb:269:in `initialize': Address already in use - bind(2) for "::1" port 3220 (Errno::EADDRINUSE)

I'm running a fairly complex stack that mirrors an 8 micro service application where things are expected to be on certain points in development so having port 3220 not working means that one of my APIs isn't available – and that's unacceptable. So I dug into it a bit and with the help of this StackOverflow, I found the answer was to locate the offending process and then kill it dead:

lsof -wni tcp:3220

That gives the process id or PID and then you can just kill it:

kill -9 12345 (or whatever)


Posted In: #rails #sysadmin #bind


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK