Take the 2-minute tour ×

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


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' 

Any idea how to really kill the process?

(This is on OSX)

share|improve this question
kill -9 <id> (and three more chars to make a comment..) –  thebjorn Feb 23 '13 at 21:40
@thebjorn - Make this an answer. –  Douglas F Shearer Feb 23 '13 at 21:41
@thebjorn Yeah! Thanks! (Why is -9 necessary?) –  user1508893 Feb 23 '13 at 21:42
I never remember exactly what the different signals are, I just think of kill <id> as "can you please stop this process" and kill -9 <id> as "kill this process.. now!" :-) –  thebjorn Feb 23 '13 at 21:45
By default, kill sends the TERM signal. Normally, this kills the process; but if the process has a handler defined for TERM, it will be run (the idea is to allow the process to clean up before exiting). If the process decides to, it can even ignore the TERM signal. kill -9, on the other hand, sends the KILL signal, which cannot be caught or ignored. –  Gordon Davisson Feb 23 '13 at 22:13
add comment

1 Answer

up vote 4 down vote accepted


kill -9 <id>

to kill stubborn processes :-)

share|improve this answer
add comment

Your Answer


