Ruby在Windows上崩溃

我面临着同样的问题在这里描述: 为什么rails-failed-with-ruby-exe-has-encountered-a-problem-and-needs-to-close 。 这是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 -v

 ruby 1.9.2p0 (2010-08-18) [i386-mingw32] 

Solutions Collecting From Web of "Ruby在Windows上崩溃"

…除了安装程序现在也崩溃1.9.2-P290

解决方法:

添加(或更改)

config.log_level =:警告

在config / environments / development.rb中

(不是我的解决方案 – 在另一个线程中找到它)

在Windows上运行1.9.2会让你成为真正的少数用户。 如果你没有1.9的明确需求,我会使用1.8.7。 具体来说,我会使用来自RailsInstaller的包: http: //railsinstaller.org/

我在1.9.2-p290的windows 7上遇到了相同的崩溃。 有人说要清除development.log文件。 我不能相信,但删除后,我的12MB开发。日志一切正常。

本地(C)扩展可能失败并将整个红宝石带下来; 在我的情况下,这是SQL服务器适配器无限循环/使用整个堆; 在我们追踪并修正了适配器中的错误( https://github.com/rails-sqlserver/tiny_tds/pull/124 )之后,它不会再次失败