使用 Ubuntu 11.04,我无法使用 CTRL-C 关闭 Rails 服务器
由于某种原因,当我输入“rails s”时,有时我无法使用 CTRL-C 关闭服务器。它使用默认的 Web brick。
有时它可以工作几个小时。其他时候它根本不起作用,如果我想关闭服务器,我必须不断地终止该进程。
这是一个已知问题吗?我该如何修复它?
如果您需要了解更多信息,请直接询问,我会尽我所能告诉您。因为我不知道是什么原因造成的,所以我不知道向您提供什么信息。
编辑:我正在添加一个 git 存储库:
gem 'rails-dev-boost', :git => 'git://github.com/thedarkone/rails-dev-boost.git', :require => 'rails_development_boost'
但公平地说,启用此行后我没有遇到此问题...并且当此 gem 行未启用时我也遇到了此问题存在。
For some reason, when I type "rails s", sometimes I can't shut the server down using CTRL-C. It's using Web brick, the default.
Sometimes it works for hours. Other times it doesn't work at all and I must constantly kill the process if I want to shut down the server.
Is this a known problem? How can I fix it?
If you need to know more info, please just ask and I'll tell you what I can. Because I don't know what is causing it, I am at a loss as to what info to provide you with.
EDIT: I am adding a git repository:
gem 'rails-dev-boost', :git => 'git://github.com/thedarkone/rails-dev-boost.git', :require => 'rails_development_boost'
But to be fair, I've not had this problem with this line enabled... and I've also had this problem when this gem line didn't exist.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我解决这个问题的方法是执行以下操作:
要在
rails 服务器
运行时停止它,请按:您将把控制权交还给
bash
。然后输入(不带 $):这将返回到进程,然后正确退出
Rails
。这有点烦人,但这肯定比手动终止进程要好。这还不错,而且是我能想到的最好的办法。
The way I solved this problem was to do the following:
To stop the
rails server
while it's running, press:You will get control back to
bash
. Then type (without the $):And this will go back into the process, and then quit out of
Rails s
properly.It's a little annoying, but this sure beats killing the process manually. It's not too bad and it's the best I could figure out.
这是一个影响 Ubuntu 11.04 的内核错误(已在 11.10 中修复,fwiw)。您可以安装内核 2.6.39 来修复它。
我正在使用 xorg-edgers PPA,其中包括 2.6.39,但我没有遇到此问题。
This is a kernel bug that affects Ubuntu 11.04 (it's fixed in 11.10, fwiw). You can install kernel 2.6.39 to fix it.
I'm using the xorg-edgers PPA which includes 2.6.39, and I don't experience the issue.