# "can't modify frozen string" error in Ajax.Updater

**URL:** <https://www.ruby-forum.com/t/cant-modify-frozen-string-error-in-ajax-updater/164535>\
**Category:** Rails\
**Created:** [April 2, 2009, 10:58am UTC](https://www.ruby-forum.com/t/cant-modify-frozen-string-error-in-ajax-updater/164535 "2009-04-02T10:58:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/4af34b/32.png) [@Heath](https://www.ruby-forum.com/u/Heath)\
**Post date:** [April 2, 2009, 10:58am UTC](https://www.ruby-forum.com/t/cant-modify-frozen-string-error-in-ajax-updater/164535/1 "2009-04-02T10:58:30Z")

</div>

I’ve just deployed my RoR app to a host that uses dispatch.cgi instead  
of Mongrel and came across this issue when using AJAX. The same issue  
has been highlighted a year ago, (on this list) \<http://  
[groups.google.com/group/rubyonrails-talk/browse\_thread/thread/](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/)  
872fed1ff554c9a4\> and (on Rails Trac) \<[http://dev.rubyonrails.org/](http://dev.rubyonrails.org/)  
ticket/10365\>.

In short, when some browsers enact the default remote\_form\_for,  
remote\_function or observe\_field procedures (which produce  
Ajax.Updater calls), the call fails and in the log appears:

Status: 500 Internal Server Error  
can’t modify frozen string  
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action\_controller/  
request.rb:598:in `gsub!’

The issue appears to be worked around by adding “:method =\> :get” to  
each remote\_function/observe\_field call, but this is far from ideal,  
and is definitely still going to cause headaches. The calls use the  
POST method by default, it seems.

Are there any developments on this bug?

---

<div class="post-metadata">

**Author:** ![Heath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/4af34b/32.png) [@Heath](https://www.ruby-forum.com/u/Heath)\
**Post date:** [April 2, 2009, 2:07pm UTC](https://www.ruby-forum.com/t/cant-modify-frozen-string-error-in-ajax-updater/164535/2 "2009-04-02T14:07:34Z")

</div>

I had the same problem deploying an application to hostgator, and I  
remember the bug would only show up using safari… I did not find any  
solution other than moving the app to DreamHost…

iPhonized!
