Question

I'm trying to run rails server to start a local server but got this error

...
WARN  TCPServer Error: Address already in use - bind(2)
Exiting
...

So I went and looked for the process that was occupying the port and killed it. The server still wouldn't start. And as it turned out, lsof still showed the process (even after it had been killed):

$ lsof -P | grep ':3000' 
ruby      52944 user    7u    IPv4 0xffffff800bdafbd8       0t0      TCP *:3000 (LISTEN)
$ kill 52944    <<<<<<< pid 52944 should have died here!
$ lsof -P | grep ':3000' 
ruby      52944 user    7u    IPv4 0xffffff800bdafbd8       0t0      TCP *:3000 (LISTEN)

Any idea how to really kill the process?

(This is on OSX)

Was it helpful?

Solution

Use

kill -9 <id>

to kill stubborn processes :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top