Activerecord getting in the way of json-jruby

I would like to use json-jruby with activerecord but it seems as if i am
running into issues with activerecord loading active_support which has
it’s own json implementation.

What makes matters worse is I am running into this redundant UTF-8
sequence issue with active_support json which does not happen with
json-jruby.

INFO: ArgumentError - redundant UTF-8 sequence:
/home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoding.rb:68:in
escape' /home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoding.rb:63:ingsub’
/home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoding.rb:63:in
escape' /home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoders/string.rb:3:into_json’
/home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoding.rb:79:in
encode' /home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoding.rb:18:inencode’
/home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoders/hash.rb:38:in
to_json' /home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoders/hash.rb:37:ineach’
/home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoders/hash.rb:37:in
map' /home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoders/hash.rb:37:into_json’
./lib/email_gateway.rb:78:in `POST /mailbox/body/?’

Any ideas?

thx.

-karl

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I was able to get around this problem by including ‘json-jruby’ after
activerecord and explicitly requiring ‘json/pure’. What is the
difference between json/pure and json/ext within jruby?

thx.

-karl

On Sep 18, 2010, at 2:32 PM, Karl B. wrote:

/home/ubuntu/.rvm/gems/jruby-1.5.2/gems/activesupport-2.3.9/lib/active_support/json/encoding.rb:79:in `encode’

-karl


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email