resque: undefined method `key?' for JSON::Ext::Generator::State
After upgrading to Rails 3.2.12 with its JSON 1.7.7 version, I have this undefined key? method error.
Here the stack trace:
activesupport (3.2.12) lib/active_support/core_ext/object/try.rb:36:in `try'
activemodel (3.2.12) lib/active_model/serializers/json.rb:91:in `as_json'
activesupport (3.2.12) lib/active_support/json/encoding.rb:47:in `block in encode'
activesupport (3.2.12) lib/active_support/json/encoding.rb:77:in `check_for_circular_references'
activesupport (3.2.12) lib/active_support/json/encoding.rb:46:in `encode'
activesupport (3.2.12) lib/active_support/json/encoding.rb:31:in `encode'
activesupport (3.2.12) lib/active_support/core_ext/object/to_json.rb:16:in `to_json'
json (1.7.7) lib/json/common.rb:223:in `generate'
json (1.7.7) lib/json/common.rb:223:in `generate'
multi_json (1.6.0) lib/multi_json/adapters/json_common.rb:10:in `dump'
multi_json (1.6.0) lib/multi_json.rb:122:in `dump'
resque (1.23.0) lib/resque/helpers.rb:25:in `encode'
resque (1.23.0) lib/resque.rb:142:in `push'
resque (1.23.0) lib/resque/job.rb:51:in `create'
resque (1.23.0) lib/resque.rb:240:in `enqueue_to'
resque (1.23.0) lib/resque.rb:221:in `enqueue'
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 30 (4 by maintainers)
Just a note for future someone.
I ended up here because I was getting this error while using sidekiq. The issue was that I was passing entire objects to the perform action, instead of just the object’s id.