我面临着这里描述的同样的问题:为什么 ruby-exe 遇到了问题并且需要关闭,rails 失败。那是 ruby 崩溃并出现以下错误:
ruby.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
我要求添加一些详细信息,因为这个问题不是我问的,我无法在其中添加信息。所以这不是重复的。
无论我如何运行(在开发中或在生产中),Ruby 最终都会崩溃,但它似乎在生产模式下更频繁地崩溃。有时按住 F5 键会崩溃,但有时我必须间歇性地按住并松开一两分钟。它似乎非常依赖于时间,但我通常可以让它在 60 秒内崩溃。
当我刷新时,GET 请求发送了 3 次,如下所示:
Started GET "/app/page" for 127.0.0.1 at 2011-02-23 10:57:35 +0530
Processing by AppController#page as HTML
Rendered pms/dashboard.html.erb within layouts/application (109.4ms)
Completed 200 OK in 141ms (Views: 140.6ms | ActiveRecord: 0.0ms)
Started GET "/app/page" for 127.0.0.1 at 2011-02-23 10:57:35 +0530
Processing by AppController#page as */*
Rendered pms/dashboard.html.erb within layouts/application (15.6ms)
Completed 200 OK in 187ms (Views: 187.5ms | ActiveRecord: 0.0ms)
Started GET "/app/page" for 127.0.0.1 at 2011-02-23 10:57:35 +0530
Processing by AppController#page as */*
Rendered pms/dashboard.html.erb within layouts/application (15.6ms)
Completed 200 OK in 219ms (Views: 218.7ms | ActiveRecord: 0.0ms)
如果我快速刷新页面,在 3 个请求之一或全部中会出现以下错误:
ERROR Errno:ECONNABORTED: An established connection was aborted by the software in your host machine:
c:/Ruby/lib/1.9.1/webrick/httpresponse.rb:323:in 'write'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:323:in '<<'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:323:in '_write_data'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:295:in 'send_body_string'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:186:in 'send_body'
c:/Ruby/lib/1.9.1/webrick/httprespose.rb:103:in 'send_response'
c:/Ruby/lib/1.9.1/webrick/httpserver.rb:86:in 'run'
ERROR Errno:ECONNABORTED: An established connection was aborted by the software in your host machine:
c:/Ruby/lib/1.9.1/webrick/httpserver.rb:56:in 'eof?'
c:/Ruby/lib/1.9.1/webrick/httpserver.rb:56:in 'run'
c:/Ruby/lib/1.9.1/webrick/server.rb:183:in 'block in start_thread'
INFO going to shutdown....
INFO WEBrick::HTTPServer#start done
我什么时候开始收到此错误?当我在项目中添加图像、CSS 和 JavaScript 时,我开始收到此错误。我还尝试删除这 3 个中的一个,看看是谁导致了错误,但每次我的 ruby.exe 崩溃时我都会看到错误:
ruby.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
我该如何解决这个问题?
当我启动服务器时,控制台上打印以下内容:
=>Booting WEBrick
=>Rails 3.0.3 application starting in development on http://0.0.0.0:3000
=>Call with -d to detach
=>Ctrl-C to shutdown server
[2011-02-23 10:59:22] INFO WEBrick 1.3.1
[2011-02-23 10:59:22] INFO ruby 1.9.2 (2010-08-18) [i386-mingw32]
[2011-02-23 10:59:22] INFO WEbrick::HTTPServer#start: pid:2448 port=3000
输出ruby -v
ruby 1.9.2p0 (2010-08-18) [i386-mingw32]