Jeffrey Warren
2008-Aug-31 18:07 UTC
[Instiki-devel] can''t modify frozen String - 0.13 on Save
I was getting this error when i try to save any page: "can''t modify frozen String" (saw the comment about separating text parsing errors from rails errors in the flash, which seems like a good idea, but I ultimately disabled the rescue so I could see the full trace) on 0.13 on a mongrel cluster at MediaTemple''s Grid Server. I poked around and traced it to line 385 of /app/controllers/wiki_controller.rb: 382 def remote_ip 383 ip = request.remote_ip 384 logger.info(ip) 385 ip.gsub!(Regexp.union(Resolv::IPv4::Regex, Resolv::IPv6::Regex), ''\0'') || ''bogus address'' 386 end Changing #385 to: 385 ip.dup.gsub!(Regexp.union(Resolv::IPv4::Regex, Resolv::IPv6::Regex), ''\0'') || ''bogus address'' seems to work. I''m not super-familiar with this codebase but it seems this is a getter method so duplicating the object seemed to be okay to me? (.clone will preserve the freeze, btw) A little out of my depth here, but thought I''d mention it if others are having this problem. I then got the (unrelated) error "problem "superclass mismatch for class Cookie" which I''ve sent another email about. Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/instiki-devel/attachments/20080831/5ca90807/attachment.html>