简体   繁体   中英

Rails Server Already Running even after server shutdown, only works again after exiting terminal

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM