Stack level too deep error when Rational number is added to Jbuilder object #72

Closed
xxx opened this Issue Oct 15, 2012 · 6 comments

3 participants

@xxx
json = Jbuilder.new
json.barf '1/10'.to_r
json.target! # kaboom
@revans

@xxx what version of ruby did you use when this happened? I tried reproducing it using 1.9.3 and it seems fine.

https://gist.github.com/4237622

@xxx
xxx commented Dec 8, 2012

Hm, it looks like the error only happens when Jbuilder is used in a Rails project. I also do not see the error when running straight Ruby, but do see it with 1.9.3-p372 when in a rails console.

@revans

what version of rails?

@xxx
xxx commented Dec 8, 2012

I just repeated it on 3.2.9

@revans

Thanks! I see where the issue is. I need to inspect more, but I think this is a rails issue.

@rwz

Try this:

MultiJson.dump('1/10'.to_r)

And if you get the same error, please paste here the output of MultiJson.adapter

@rwz rwz closed this Dec 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment