This phenomenon happens occasionally, so make a note as a reminder. I hope it helps those who have just started Rails and have fallen into the same situation.
I'm working on an app while launching a local server and checking the operation with chrome ...
When I thought it was unstable and waited steadily, I noticed that only the localhost: 3000 tab was stopped.
When I try control + c
in the terminal, it doesn't respond ... what is this ...
I'm afraid to kill it, so what's the matter?
Figure reading `/ articles``
Use the lsof
command to check the processing running on port number 3000.
↓ Result of lsof -i: 3000
(Actually, there is output in the columns after USER)
daikimorita@daikinoMacBook-Pro javascript_skillcheck % lsof -i:3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Google xxxx
localhost:55103->localhost:hbci (ESTABLISHED)
ruby xxxxx
localhost:hbci (LISTEN)
ruby xxxxx
localhost:hbci (LISTEN)
ruby xxxxx
localhost:hbci->localhost:54631 (CLOSE_WAIT)
ruby xxxxx
localhost:hbci->localhost:54636 (CLOSE_WAIT)
ruby xxxxx
localhost:hbci->localhost:54655 (CLOSE_WAIT)
ruby xxxxx
localhost:hbci->localhost:54656 (CLOSE_WAIT)
ruby xxxxx
localhost:hbci->localhost:54659 (CLOSE_WAIT)
ruby xxxxx
localhost:hbci->localhost:55103 (ESTABLISHED)
The PID of ruby is displayed as xxxxx (enters a number). I want to stop this.
The number of lines is because I pressed control + c
many times lol
Execute the following command.
kill -9 xxxxx
If you look at the "Tab of the terminal running rails s
", you will see killed
and it is in standby mode.
zsh: killed
When I launched it again with rails s
, the page was displayed in chrome safely. Solution!
Rails server process is dropped quickly About PID About localhost: 3000 (Rails server process is dropped quickly ](https://qiita.com/kanuu/items/fd6e33fca6ad6a90d059#comments) )
Recommended Posts