To_json conflict with json gem and rails 2.1


#1

hey folks,

this has been brought up twice in this group and once in rails core,
but I couldn’t find a solution.

Specifically, I’m using the twitter gem within my rails project, and
this eventually loads in the json gem. It wreaks havoc and throws
this error:

wrong argument type Hash (expected Data)

when calling .to_json.

The problem is that it the json gem and active_support create
different to_json method signatures for data types like date, time,
etc.

What is the preferred way to work around this issue? I’ve tried all
the different loading combinations that I can think of (require ‘json’
before and after active_support, etc), but with no luck. Has anyone
solved this issue? (lets assume I have to load both active_support
and json)

Thanks in advance!
Adam


#2

same problem here, any solution yet?