Forum: Ruby on Rails to_json conflict with json gem and rails 2.1

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Adam G. (Guest)
on 2009-01-11 04:58
(Received via mailing list)
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,

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!
matthias (Guest)
on 2009-02-02 18:10
(Received via mailing list)
same problem here, any solution yet?
This topic is locked and can not be replied to.