Whenever an exception is thrown (and not caught) during rendering in my Rails application, Rails dies immediately with no stack trace or error screen. The symptom is, from the outside, "pages with errors look blank white", but I''m pretty sure that''s just what you see when a connection is closed and no response has been sent from the server. Does anyone have any idea what could be causing this, or how to find out? I have replicated it running Rails under Mongrel, lighttpd/fastcgi, and webrick (even in debug mode), all with exactly the same results - no information, no stack traces, just a sudden halt. Thanks, Emmett -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
What''s in your development.log? On Dec 6, 1:27 pm, Emmett Shear <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Whenever an exception is thrown (and not caught) during rendering in > my Rails application, Rails dies immediately with no stack trace or > error screen. The symptom is, from the outside, "pages with errors > look blank white", but I''m pretty sure that''s just what you see when a > connection is closed and no response has been sent from the server. > > Does anyone have any idea what could be causing this, or how to find > out? I have replicated it running Rails under Mongrel, > lighttpd/fastcgi, and webrick (even in debug mode), all with exactly > the same results - no information, no stack traces, just a sudden > halt. > > Thanks, > Emmett > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Matt White wrote:> What''s in your development.log? > > On Dec 6, 1:27 pm, Emmett Shear <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>I have a reduced test case: a layoutless render of a template containing "<% raise ''foo'' %>" This is what the log looks like: Processing LiveController#errorer (for 127.0.0.1 at 2007-12-06 11:52:49) [GET] Session ID: 85a4ebcc60791ecbb58db428ef191a66 Parameters: {"action"=>"errorer", "controller"=>"live"} User Load Including Associations (0.074950) SELECT users."id" AS t0_r0, users."login" AS t0_r1, users."password_hash" AS t0_r2, users."stream_key" AS t0_r3, users."viewer_karma" AS t0_r4, users."publisher_karma" AS t0_r5, users."updated_on" AS t0_r6, users."created_on" AS t0_r7, users."fans_count" AS t0_r8, users."dmca_violation" AS t0_r9, users."terms_of_service_violation" AS t0_r10, user_properties."id" AS t1_r0, user_properties."user_id" AS t1_r1, user_properties."name" AS t1_r2, user_properties."kind" AS t1_r3, user_properties."val" AS t1_r4 FROM users LEFT OUTER JOIN user_properties ON user_properties.user_id = users.id WHERE (name = ''persistent_cookie'' and val = ''emmett|f91c80c4b2e1590e98092cca54d514ba6127c57c|Wed Dec 19 12:08:25 -0800 2007'') MemCache get (0.012725) Rendering live/errorer ...it just cuts off there. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I figured it out! I had extended class Array with a sum method; apparently Rails does not like that for some reason, because once I renamed it sum_all there was no problem. Sorry to have bothered everyone. Emmett -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Array already has a sum method on it (inherited from Enumerable). I wouldn''t recommend over-riding a built-in class''s method unless you know exactly what it does. On Dec 7, 2007 12:55 PM, Emmett Shear <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I figured it out! > > I had extended class Array with a sum method; apparently Rails does not > like that for some reason, because once I renamed it sum_all there was > no problem. > > Sorry to have bothered everyone. > > Emmett > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
$ irb>> [1, 2, 3].sumNoMethodError: undefined method `sum'' for [1, 2, 3]:Array from (irb):1 Maybe I have a different version of Ruby? $ ruby -v ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1] That''s why I added it...Array#sum didn''t seem to exist. Did it appear in some other version of ruby? Emmett -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think it might be added in rails? Try script/console. On Dec 7, 2007 1:28 PM, Emmett Shear <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > $ irb > >> [1, 2, 3].sum > NoMethodError: undefined method `sum'' for [1, 2, 3]:Array > from (irb):1 > > Maybe I have a different version of Ruby? > > $ ruby -v > ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1] > > > That''s why I added it...Array#sum didn''t seem to exist. > > Did it appear in some other version of ruby? > > Emmett > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Bingo. Rails adds it''s own Array#sum, and adding mine must be causing a conflict. That''s what I get for treating Rails like Ruby... :-P Thanks, I understand what''s going on now. Emmett -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
markus-JwLqD+LtGXNBDgjK7y7TUQ@public.gmane.org
2007-Dec-07 16:01 UTC
Re: Mysterious Rails Crashes
ActiveRecord adds its own Array#sum (it might actually be on Enumerable--this is from 6mo memory) that takes an additional parameter. If you define it in the obvious was, kaboom!, but if you don't define it yourself the one they provide works fine. --MarkusQ Sent via BlackBerry from T-Mobile -----Original Message----- From: Emmett Shear <rails-mailing-list@andreas-s.net> Date: Fri, 7 Dec 2007 03:25:53 To:rubyonrails-talk@googlegroups.com Subject: [Rails] Re: Mysterious Rails Crashes I figured it out! I had extended class Array with a sum method; apparently Rails does not like that for some reason, because once I renamed it sum_all there was no problem. Sorry to have bothered everyone. Emmett -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---