Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails server doesn't shutdown with CTR+C in Windows 7

I'm using the default "rails server" command to launch a web server from the command line. For some reason, neither CTR+C nor CTR+Z seem to shutdown the server.

The web server appears to be running normally. Closing the terminal does shutdown the web server. CTR+C has the normal copy behavior in other applications. I'm having this problem when I launch the web server from the Windows command prompt and PowerShell windows.

Is this expected behavior, what could be my problem, or what can I do to investigate further?

like image 827
Thomas Langston Avatar asked Mar 12 '12 00:03

Thomas Langston


People also ask

How do I shutdown a Rails server?

For Rails 5.0 and above, you can use this command Use ctrl+c to shutdown your Webrick Server.

How do you stop rails server forcefully?

One way to shut down a rogue server is with the kill command. For the PID output above, you could kill the corresponding stuck server using kill 42612 . And if that didn't work, you could try kill -9 42612 .


2 Answers

You can use Ctrl + Pause or Break to stop rails server from the MS-DOS command prompt

like image 142
Vincent Hua Avatar answered Oct 10 '22 02:10

Vincent Hua


If you use a notebook and do not have Pause and Break buttons, then you can try to stop rails server by Ctrl+Fn+Ins. It works for my Lenovo.

like image 40
Evgeny Liskovets Avatar answered Oct 10 '22 02:10

Evgeny Liskovets