Nauhaie None
2008-Mar-27 12:54 UTC
Safari 3.1 AJAX crashes not caused by getElementsByClassName
Hi all,
I''ve been having a lot of trouble with Rails Errors for over I week,
and
I finally realized that they are caused by Safari 3.1, since everything
works fine with FireFox... Pretty much every AJAX request makes the fcgi
process crash...
Moreover, I do *not* use getElementsByClassName (which is known to be
the cause of many problems), rails is up to date, and so is Prototype
(1.6.0.1).
Here is what the log says:
/!\ FAILSAFE /!\ Thu Mar 27 13:47:50 +0100 2008
Status: 500 Internal Server Error
can''t modify frozen string
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/request.rb:462:in
`gsub!''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/request.rb:462:in
`clean_up_ajax_request_body!''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/request.rb:380:in
`parse_formatted_request_parameters''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:78:in
`request_parameters''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/request.rb:287:in
`parameters''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/request.rb:22:in
`request_method''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/request.rb:35:in
`method''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/routing.rb:1483:in
`extract_request_environment''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/routing.rb:1424:in
`recognize''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:170:in
`handle_request''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in
`dispatch''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in
`dispatch_cgi''
/hsphere/local/home/cukch/rails/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in
`dispatch''
dispatch.cgi:10
I have no idea what this is caused by. The solution that was recommended
is switching to Mongrel, and of course I would do it if I could... But I
am on a shared host, so it is not possible...
Does anyone has any idea how to solve this? I have tried for over a
week, and nothing helps. I tried switching from fastcgi to plain old
cgi, but the bugs remain the same (but plain old cgi is indeed used, for
the request take a lot longer).
Thank you very much if you can help!
Nauhaie
--
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
-~----------~----~----~----~------~----~------~--~---
Nauhaie None
2008-Mar-27 13:46 UTC
Re: Safari 3.1 AJAX crashes not caused by getElementsByClass
I tried replacing
vendor/rails/actionpack/lib/action_controller/request.rb:462
---------
def clean_up_ajax_request_body!(body)
body.chop! if body[-1] == 0
body.gsub!(/&_=$/, '''')
end
---------
BY
---------
def clean_up_ajax_request_body!(body)
unless body.frozen?
body.chop! if body[-1] == 0
body.gsub!(/&_=$/, '''')
end
end
---------
I don''t know if this might cause other kinds of problems, but at least,
it doesn''t crash anymore...
--
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
-~----------~----~----~----~------~----~------~--~---
A. james Boswell
2008-Mar-28 23:19 UTC
Re: Safari 3.1 AJAX crashes not caused by getElementsByClass
Nauhaie None wrote:> I tried replacing > vendor/rails/actionpack/lib/action_controller/request.rb:462 > > --------- > def clean_up_ajax_request_body!(body) > body.chop! if body[-1] == 0 > body.gsub!(/&_=$/, '''') > end > --------- > > BY > > --------- > def clean_up_ajax_request_body!(body) > unless body.frozen? > body.chop! if body[-1] == 0 > body.gsub!(/&_=$/, '''') > end > end > --------- > > I don''t know if this might cause other kinds of problems, but at least, > it doesn''t crash anymore...Unfortunately I am in shared hosting, can''t change fast-cgi to mongrel and can''t hack request.rb. Looks like I''m snookered until Safari/Fast-CGI/ or rails patches the bug. Can anyone think of any other way to work around this? It basically rules out AJAX from RoR for me which is a major blow! -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Mar-29 15:35 UTC
Re: Safari 3.1 AJAX crashes not caused by getElementsByClass
On 28 Mar 2008, at 23:19, A. james Boswell wrote:> > Nauhaie None wrote: >> I tried replacing >> vendor/rails/actionpack/lib/action_controller/request.rb:462 >> >> --------- >> def clean_up_ajax_request_body!(body) >> body.chop! if body[-1] == 0 >> body.gsub!(/&_=$/, '''') >> end >> --------- >> >> BY >> >> --------- >> def clean_up_ajax_request_body!(body) >> unless body.frozen? >> body.chop! if body[-1] == 0 >> body.gsub!(/&_=$/, '''') >> end >> end >> --------- >> >> I don''t know if this might cause other kinds of problems, but at >> least, >> it doesn''t crash anymore... > > Unfortunately I am in shared hosting, can''t change fast-cgi to mongrel > and can''t hack request.rb. >You can if you freeze rails into your vendor/rails . IIRC this here is to work around a bug in some versions of safari where extra stuff would get appended to the end of ajax requests. Fred> Looks like I''m snookered until Safari/Fast-CGI/ or rails patches the > bug. > > Can anyone think of any other way to work around this? It basically > rules out AJAX from RoR for me which is a major blow! > -- > 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 -~----------~----~----~----~------~----~------~--~---
A. james Boswell
2008-Mar-29 22:41 UTC
Re: Safari 3.1 AJAX crashes not caused by getElementsByClass
Frederick Cheung wrote:> On 28 Mar 2008, at 23:19, A. james Boswell wrote: >>> I don''t know if this might cause other kinds of problems, but at >>> least, >>> it doesn''t crash anymore... >> >> Unfortunately I am in shared hosting, can''t change fast-cgi to mongrel >> and can''t hack request.rb. >> > You can if you freeze rails into your vendor/rails . IIRC this here is > to work around a bug in some versions of safari where extra stuff > would get appended to the end of ajax requests.Thanks Fred, So I''m guessing this means cp''ing from the /usr/lib/ tree through to either my own project or my own gems path. Is this a manual process is there some rails scripted way to freeze? Also - if I set my GEMS path correctly, can I move only the relevant files across? -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Mar-30 09:11 UTC
Re: Safari 3.1 AJAX crashes not caused by getElementsByClass
On Mar 29, 11:41 pm, "A. james Boswell" <rails-mailing-l...@andreas- s.net> wrote:> Frederick Cheung wrote: > Thanks Fred, > So I''m guessing this means cp''ing from the /usr/lib/ tree through to > either my own project or my own gems path. Is this a manual process is > there some rails scripted way to freeze? > > Also - if I set my GEMS path correctly, can I move only the relevant > files across?There''s a rake task: rake rails:freeze:gems It''s an all or nothing thing, you can''t just freeze some gems or some files Fred> -- > 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
A. james Boswell
2008-Mar-30 09:17 UTC
Re: Safari 3.1 AJAX crashes not caused by getElementsByClass
Frederick Cheung wrote:> There''s a rake task: rake rails:freeze:gems > It''s an all or nothing thing, you can''t just freeze some gems or some > files > > FredThanks so much Fred! just what I needed to know :-) Cheers AJB -- 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 -~----------~----~----~----~------~----~------~--~---
A. james Boswell
2008-Mar-30 09:25 UTC
Re: Safari 3.1 AJAX crashes not caused by getElementsByClass
A. james Boswell wrote:> Thanks so much Fred! > just what I needed to know :-)Dang! Spoke too soon Freezing to the gems for Rails 2.0.2 Unpacked gem: ''/home/familie2/registration/vendor/rails/activesupport-2.0.2'' ERROR: While executing gem ... (Gem::Exception) Cannot load gem at [/home/familie2/.gems/cache/activerecord-2.0.2.gem] in /home/familie2/registration/vendor/rails Do I need to clobber the cache somehow? -- 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 -~----------~----~----~----~------~----~------~--~---