Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby crashes on windows

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 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.

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)

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

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.

How can I solve this?


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

Output of ruby -v

ruby 1.9.2p0 (2010-08-18) [i386-mingw32]
like image 375
Harry Joy Avatar asked Feb 23 '11 05:02

Harry Joy


3 Answers

... except the installer is now ALSO the crashing 1.9.2-p290

Workaround:

Add (or change)

config.log_level = :warn

in config/environments/development.rb

(not my solution - found it in another thread)

like image 165
Oskar Holmkratz Avatar answered Sep 20 '22 17:09

Oskar Holmkratz


Running 1.9.2 on windows puts you in a REALLY small minority of users. If you don't have an explicit need for 1.9, I'd use 1.8.7. Specifically, I'd use the package from RailsInstaller: http://railsinstaller.org/

like image 44
Jeff Casimir Avatar answered Sep 21 '22 17:09

Jeff Casimir


i got the same crashes on windows 7 with 1.9.2-p290. someone said to clear development.log file. i can't believe but after deleting my 12mb development.log everything works fine.

like image 26
madflanderz Avatar answered Sep 19 '22 17:09

madflanderz