RoR + AJAX + Safari = 500 Internal Server Error

Hi everyone,

I am running essentially the stock AJAX demo from here,

and it is working fine in every browser except one. Nope! Not that one! It's actually Safari which is giving me trouble. I know! Using a link_to_remote call, for all other browsers places the sample text into the div after the text, but in Safari, the server is apparently returning a 500 Internal Server Error.

All I can think of is that Safari is creating a malformed request ... have a look:

http://www.mightywork.com/sandbox/toys/ajaxy

Can anyone help me to explain this most bizarre behavior? If I do get my host involved (dreamhost), I would like to at lease know what to ask them to fix.

Thanks in advance,

Whit

More information:

According to the log, a successful (Firefox) execution looks like this:

I am seeing this problem and I could reproduce this problem with FF, Opera and Safari from the Mac. It looks like a gem specific problem, Is there a patch or workaround ?

-Arul

Interesting. I am seeing the same problem with my online deployment on a FastCGI server. However, my local mongrel does not have the problem at all. Very strange. This problem seems to be related to any Ajax.request. My in place editors don't work. Same for autocompletion and all remote form tags.

My hypothesis is that this is an interaction between ROR 2.0.2 and FastCGI.

I saw a trouble ticket on the rails trac that matches up:

http://dev.rubyonrails.org/ticket/10365

My initial gut feel on this has proved to be true. I migrated from FastCGI to Mongrel and all of my Ajax problems magically disappeared.

I don't know if it is a general FastCGI + Ajax problem, or if it is specifically how my service provider has FastCGI tuned out, but the exact same codebase works just fine on a Mongrel instance.

-J

I have the same problem... However, I cannot switch to Mongrel...

Nauhaie

Given that you seem to be alone in seeing this on all browsers, can I ask more about your configuration that you were running your app on? So far, everything else seems to indicate fcgi and not rails, and seems to be unique to the rails + fcgi + apache2 + Safari combination.

rails 2.0.2 + fcgi 0.8.7 + apache2 + safari/FF/Opera combination was working fine on my local Leopard (Mac OSX 10.5) machine. When I deployed the code to bluehost (rails 2.0.2 + fcgi 0.8.7 + apache2), I was having problems in remote_form_tag as mentioned in the below ticket,

http://dev.rubyonrails.org/ticket/10365

I tried a workaround by changing the method as get for AjaxRequest and it works for now. But, still would like to find the root cause of this failure..

-Arul

Hi,

can you post your snippet?

thx