On Mon, Feb 8, 2010 at 3:33 AM, kiko <[email protected]> wrote:
>
> Last time I had the same issue when I was upgrading ruote.  The
> solution was to move to yajl-json which worked out.  Now I'm running
> ruote 2.1.5 find using native ruby.  Now I'm trying to move to using
> jruby and the error poped up again.  Jruby can't compile yajl-ruby so
> I'm using jruby-json instead.  But this stack trace seems to be coming
> from rufus-json, so I'm wondering if you've come across this, hoping
> this doesn't block our port to jruby.

Hello Franciso,

I did this little experiment :

---8<---
require 'rubygems'
require 'json'

puts `ruby -v`
puts `gem search json`

h = {}
p = h
(1..21).each do |i|
  p['a'] = {}
  p = p['a']
end

s = h.to_json

p s

h = JSON.parse(s)

p h
--->8---

Here are the results :

---8<---
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_17) [x86_64-java]
json-jruby (1.2.0)
"{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{\"a\":{}}}}}}}}}}}}}}}}}}}}}}"
t.rb:19: nesting of 20 is too deep (JSON::NestingError)
--->8---

I'm afraid I can't help with that one. The json-jruby thing seems to
be a faithful port to jruby, even when it comes to limitations.

I've googled a bit :

  
http://archive.montage.codehaus.org/lists/org.codehaus.jruby.user/msg/[email protected]
  http://github.com/brianmario/yajl-ruby/tree/ffi

The FFI branch is in pause since november :(


> Other solutions is try using regular json gem which does compile work
> with jruby but then I'm afraid I'll probably get the same error cause
> that's what happened with native ruby.  Another one would be to change
> the ruote process definitions so they don't go so deep.

Refactoring for the win.


Best regards,

-- 
John Mettraux   -   http://jmettraux.wordpress.com

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to