Ruby 在 Windows 上崩溃 [英] Ruby crashes on windows
问题描述
我遇到了这里描述的同样问题:为什么rails-fails-with-ruby-exe-has-encountered-a-problem-and-needs-to-close.即 ruby 因以下错误而崩溃:
I'm facing same problem described here: why-rails-fails-with-ruby-exe-has-encountered-a-problem-and-needs-to-close. that is ruby get crashed with following error:
ruby.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
我要求添加一些详细信息,因为我没有提出这个问题,我无法在其中添加信息.所以这不是重复的.
I'm asking this to add some details on it as that question was not asked by me I am not able to add information in it. So this is not duplicate.
无论我如何运行(在开发或生产中)Ruby 最终都会崩溃,但它似乎在生产模式下更频繁地崩溃.有时按住F5键会崩溃,但有时我必须间歇地按住并释放一两分钟.它似乎非常依赖于时间,但我通常可以在不到 60 秒的时间内让它崩溃.
Ruby crashes eventually no matter how I run it (in development or in production), but it seems to crash more often in production mode. Sometimes it will crash when I hold down the F5 key, but sometimes I have to hold and release it intermittently for a minute or two. It appears to be very dependent on timing, but I can usually make it crash in less than 60 seconds.
当我刷新 GET 请求时发送 3 次如下:
When I refresh the GET request is sent for 3 times as follows:
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 个请求中的一个或所有请求中会出现以下错误:
And if I rapidly refresh the page get following error in one of or all the 3 request:
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 崩溃时,我都会看到错误:
When I started to get this error? When I added images, css and javascript in my project I started to get this error. I also tried by removing one of this 3 and see who causes the error but every time my ruby.exe get crashed and i see the error:
ruby.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
我该如何解决这个问题?
当我启动服务器时,控制台上会打印以下内容:
When I start server following is printed on console:
=>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]
推荐答案
...除了安装程序现在也是崩溃的 1.9.2-p290
... except the installer is now ALSO the crashing 1.9.2-p290
解决方法:
添加(或更改)
config.log_level = :warn
config.log_level = :warn
在 config/environments/development.rb 中
in config/environments/development.rb
(不是我的解决方案 - 在另一个线程中找到)
(not my solution - found it in another thread)
这篇关于Ruby 在 Windows 上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!