nixme / pry-debugger

Pry navigation commands via debugger (formerly ruby-debug)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pry-remote show address already in use when quit from rails app

kdstarter opened this issue · comments

I am trying to debug a Rails app running inside foreman, when I type quit from pry-remote, there is an error Errno::EADDRINUSE (Address already in use - bind(2) for "127.0.0.1" port 9876). It's similar with issue Mon-Ouie/pry-remote#42, is there any problem?

commented

What is causing this issue?

commented

I have the same problem.

commented

I have the same problem. too

👍

me too. =/

I encounter this everyday. Killing the process usually works. Just do a netstat and find port 9876, then kill the process listening on that port.

Just had this happen to me too

In terminal, put:
lsof -i tcp:9876
Check the PID column. that's the PID you want to kill.
put:
kill -9 <PID>

@BrennerSpear Thanks. Is it possible to write this as a one-liner that pipes the PID to the kill command? I know enough bash to know what I don't know.

@snoblenet I don't know enough bash to even know what any of those commands really mean - I just googled enough to figure it out.

@BrennerSpear worked it out:

kill -9 $(lsof -ti tcp:9876)