I don’t like writing short posts about fixing code errors but I think this one deserves a quick shout out. If you get an error in your Rails application that says “interning empty string”, there could be something wrong with an error message in your validations. For example, I had something like:
def geocoding_works_when_geotarget_is_true if geotarget and (self.lat == nil or self.lng == nil or self.address_changed?) errors.add("Provide better location information so that we can geotarget your reminders.") unless geocode end end
The ‘.’ in my error message caused an “interning empty string” error. I hope I save someone an hour by posting this.
No TweetBacks yet. (Be the first to Tweet this post)
If you enjoyed this post, make sure you subscribe to my RSS feed!











5 Comments
Excellent post. saved me hours of digging into the problem. Did you find out why this problem occurs?
Haven’t looked into it much further. Drop a comment if you find out.
Thank you for this post. You saved me a ton of debugging time. That is a strange Rails bug.
Thank you so much for this. I murdered an hour on this before resorting to Google. Found your page right away, and in my case it was “…” in the error message causing the problem.
I’m glad this is saving people time. It’s sort of a lame post but serves the intended purpose.