問題:
How do I find (and kill) processes that listen to/use my tcp ports?如何找到(並殺死)偵聽/使用我的 tcp 端口的進程? I'm on mac os x.我在 mac os x 上。
Sometimes, after a crash or some bug, my rails app is locking port 3000. I can't find it using ps -ef...有時,在崩潰或某些錯誤之後,我的 rails 應用程序鎖定了端口 3000。我無法使用 ps -ef 找到它...
When doing做的時候
rails server
I get我得到
Address already in use - bind(2) (Errno::EADDRINUSE)地址已被使用 - bind(2) (Errno::EADDRINUSE)
2014 update: 2014年更新:
To complete some of the answers below: After executing the kill commands, deleting the pid file might be necessary rm ~/mypath/myrailsapp/tmp/pids/server.pid
要完成下面的一些答案: 執行 kill 命令後,可能需要刪除 pid 文件rm ~/mypath/myrailsapp/tmp/pids/server.pid
解決方案:
參考一: https://en.stackoom.com/question/GAtT參考二: https://stackoom.com/question/GAtT