Ctrl+C doesn´t work in rails 3.2.2 #5360

davesvs opened this Issue Mar 9, 2012 · 6 comments


None yet

5 participants

davesvs commented Mar 9, 2012

When you start Webrick with rails 3.2.2 Ctrl-C doesn't work and the server doesn't stop

radar commented Mar 9, 2012

[scumbag OSS guy] WORKS FOR ME!

We're going to need way more information about your system. What operating system? How did you create the application? What terminal are you using?

davesvs commented Mar 10, 2012

Hi, I'm using windows xp sp3, i installed using railsinstaller_2.1.0 (www.railsinstaller.org), This installer install rails 3.2.1 and I was executed 'gem update' to update to 3.2.2 ...

I've created my app using 'rails new app_example' and then 'rails s' and then Ctrl-C doesn't work in webrick, using the windows console (cmd.exe). The web server process (webrick) stop when i close the window ...

Similar behavior for me with Windows 7 (32bit). Installed with railsinstaller 2.1.0 as well and I have the same version of rails as @davesvs. Ruby version is 1.9.3. Neither CTR-C nor CTR-Z kill webrick from the windows console or a powershell window.


I was going to post that I also had this issue, but after much googling, it turns out that it is a Ruby issue: http://bugs.ruby-lang.org/issues/6131

As a work-around, ctrl + pause/break works to terminate the process, but we'll have to wait for the next ruby patch for it to be fully fixed.

EDIT ...And actually, after reading some more about it, Ruby looks like it was indeed changed so that the Interrupt signal now comes from CTRL_BREAK_EVENT only, rather than also from CTRL_C_EVENT. This appears to be due to the way Windows handles process groups, which is probably how the rails server command launches. ( From http://bugs.ruby-lang.org/issues/5812 rev 34389 ) ( http://jstorimer.com/2011/12/20/rails-and-exec.html also explains a bit about what happens there, though in a UNIX context... )

So, yeah. The more you know. Now we just need to see what kind of fix if any will happen. (Changed a double-post to an edit as well, sorry about that!)

EDIT 2: Calling "ruby script\rails server" has ctrl+c working as intended. So, it's the ruby bug, as explained in here: https://groups.google.com/forum/?fromgroups#!topic/thecodeshop/ZI9FY-RKYgs (Luis's post from March 9)


Hey guys. Can I close this issue?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment