Reputation: 543
I'm using Rails 4.0 on Mountain Lion.
I've looked at other questions on SO regarding this problem, but the answers I've seen are to simply delete the server.pid file in question. Doing so is only a temporary fix for me, as it reappears when I start the server again and does not go away. (Or rather, the PID number within the file does not go away). I'm not trying to run multiple servers, only trying to be able to shut down the server within the terminal and then start it back up.
When I open a fresh terminal and start a rails server it works the first time. If I shut the server down, and try to restart it again, I'm given the "Already Running" message. Now, what works is if I completely exit the terminal, and open a new terminal window. But this is getting rather tedious. Does anyone know what the deal might be?
Upvotes: 0
Views: 268
Reputation: 8006
Use control-C
to shutdown rails properly.
If you are running a tailing command, like rails does, you use control-C
to shut it down correctly.
If you are running a console command such as SSH, PostgreSQL, or Rails Console, you use control-D
to exit properly.
I have no idea why (maybe someone can tell me), but that is how it is.
Upvotes: 1