11

In the past, I could exit my rails application launched using webbrick using CtrlC. At some point in development, this functionality broke ( CtrlC does nothing now). I'm lead to believe this was caused by changes in one of my gem dependencies, as the problem is also present when checking out a really old version of the application, using the current gemset.

My question is: how can I fix this problem, or at least find the out what is causing it?

Vukašin Manojlović
  • 2,645
  • 2
  • 21
  • 26
drewrobb
  • 1,574
  • 10
  • 24

8 Answers8

10

For windows users, this was broken in more recent builds of rails (3.2+). Try using

ruby script\rails server

instead. More details here.

lambinator
  • 10,616
  • 7
  • 55
  • 57
9

Try Ctrl+Break. It should work.

Sergey Glotov
  • 20,200
  • 11
  • 84
  • 98
Hugo
  • 91
  • 1
  • 1
5

I had the same issue with an application. It would seem that the issue is not with the authlogic gem but with the ":git" option. My entry causing webrick & mongrel to stop responding to Ctrl+C was

gem 'globalize3', :git => 'git://github.com/refinerycms/globalize3.git'
  • 1
    I just started having this problem with my system, getting paperclip from its :git source. I commented out the :git and it's working just fine. Upvote for giving specifics of the problem. – Josh Kovach May 01 '11 at 19:53
  • Look at this question [#6086601](http://stackoverflow.com/questions/6086601/using-ubuntu-11-04-i-cant-shut-down-rails-server-using-ctrl-c/6109606#6109606) for a workaround – Adrien Coquio Jun 15 '11 at 16:22
1

Interesting experience (and good workaround for the next weeks):

If you are under Ubuntu and use Guake for quick terminal access, you can launch

rails s

there. Ctrl + C reproducibly works there for me and stops the server.

Hope I could help! :)

Dorian
  • 11
  • 2
0

Seemed to have solved my own problem. Authlogic

gem "authlogic", :git => 'http://github.com/binarylogic/authlogic.git'

appears to be the root cause of this problem. I've opened an issue here

drewrobb
  • 1,574
  • 10
  • 24
  • dear , it was not the solution / answer of your question , i think you should some one else post with higher votes , which lead to actual solution to you answer . – Mani Jan 12 '16 at 11:56
0

I have been experiencing similar issues, specifically on Ubuntu 11.04 (things were fine on 10.04). I've created another question that was more specific to my particular setup, but it sounds like there is a lot of crossover, so people might be interested in reading it as well: Can't stop WEBrick 1.3.1 with ctrl-c on Ubuntu 11.04

Community
  • 1
  • 1
Gordon McCreight
  • 2,579
  • 1
  • 22
  • 15
0

I was experiencing this problem on Ubuntu 11.04, Ruby 1.9.2p290. This fixed it for me:

Remove all existing Ruby & Ruby-related packages

Install RVM

Install Ruby 1.9.3

$ rvm install 1.9.3
$ rvm use 1.9.3

Make sure it works

$ ruby -v
ruby 1.9.3dev (2011-09-23 revision 33323) [x86_64-linux]

Install all your gems, etc...

PJK
  • 2,082
  • 3
  • 17
  • 28
0

why not trap()ing signals?
http://theriyanto.wordpress.com/2006/04/05/develop-a-simple-webserver-using-webrick/

glasz
  • 2,526
  • 25
  • 24