CTRL+C won't stop a sinatra app

可紊 提交于 2019-12-10 15:29:57

问题


Normally when I run a rails app from the console during development I can just press Ctrl + C and it exits. Then I can run the app again, thus bouncing it and effecting changes.

I am running a sinatra app. I just run the ruby file.

$: ruby myapp.rb

When I press Ctrl+C, however, it won't stop the app. I've had to bring up the Ubuntu System Monitor and kill the Ruby process. Very annoying.

Anyone seen this/dealt with this before?


回答1:


I installed the 'thin' gem and it works fine.

Apparently sinatra + Webrick is unstoppable.

(Also, running Ubuntu 11.04.)




回答2:


Try the exit method, which should exit you out of the Sinatra Irb according to the following reference:

http://sinatra.rubyforge.org/doc/classes/Sinatra/Irb.html#M000029



来源:https://stackoverflow.com/questions/5900102/ctrlc-wont-stop-a-sinatra-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!