Rafi Jacoby
unread,Jul 27, 2009, 9:38:49 PM7/27/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Talk
Trying to move a project to Rails 2.3.3, and getting the following:
NoMethodError: undefined method `[]' for #<JSON::Ext::Generator::State:
0x2407ea8>
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/
active_support/json/encoders/hash.rb:45:in `as_json'
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/
active_support/json/encoders/hash.rb:34:in `to_json'
I understand that the to_json/as_json stuff changed, but this is for
something simple (using just hashes) like:
JSON.generate({"foo"=>"bar"})
I'm using latest json gem, tried requiring active_support before json,
and put this into my environment as suggested by the Rails upgrade
notes:
ActiveSupport::JSON.backend = 'JSONGem'
No dice.
If I use Rails 2.3.2, it's happy.
Anyone encounter/conquer this?
Tx,
Rafi