I’ve been on this for a bit now trying to find out why this breaks but
I can’t. Hopefully someone else will have some idea.
I’ve been compiling a hash of which one of the objects is request.env.
I then call #to_json on the hash but it fails with:
“You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.pop”
Calling #to_json on request.env.to_hash also fails with error “stack
level too deep”.
From the backtrace you can see a loop of the following happening:
encode' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/ json/encoding.rb:19:insend’
encode' /Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/ json/encoders/hash.rb:38:into_json’
Anyone have any thoughts on this?