You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The encoder is not correctly initialized when insensitive hash objects are deserialized using psych which is shipped with Ruby 2. Here is an example on Ruby 2.3.1p112:
irb(main):011:0> Psych.load(Psych.dump({a: 1}))
=> {:a=>1}
irb(main):012:0> Psych.load(Psych.dump({a: 1}.insensitive))
NoMethodError: undefined method `call' for nil:NilClass
Did you mean? caller
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/insensitive_hash-0.3.3/lib/insensitive_hash/insensitive_hash.rb:218:in `encode'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/insensitive_hash-0.3.3/lib/insensitive_hash/insensitive_hash.rb:209:in `lookup_key'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/insensitive_hash-0.3.3/lib/insensitive_hash/insensitive_hash.rb:127:in `delete'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/insensitive_hash-0.3.3/lib/insensitive_hash/insensitive_hash.rb:87:in `[]='
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:362:in `block in revive_hash'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:336:in `each'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:336:in `each_slice'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:336:in `revive_hash'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:271:in `block in visit_Psych_Nodes_Mapping'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:268:in `each'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:268:in `each_slice'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:268:in `visit_Psych_Nodes_Mapping'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/delayed_job-4.0.0/lib/delayed/psych_ext.rb:133:in `visit_Psych_Nodes_Mapping_with_class'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/visitor.rb:16:in `visit'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/visitor.rb:6:in `accept'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:32:in `accept'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:311:in `visit_Psych_Nodes_Document'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/visitor.rb:16:in `visit'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/visitor.rb:6:in `accept'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:32:in `accept'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych/nodes/node.rb:38:in `to_ruby'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/2.3.0/psych.rb:253:in `load'
from (irb):12
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-3.2.22.2/lib/rails/commands/console.rb:47:in `start'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-3.2.22.2/lib/rails/commands/console.rb:8:in `start'
from /Users/ryan/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-3.2.22.2/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
irb(main):013:0>
Notice that this is not an issue on ruby 1.9.3p551:
The encoder is not correctly initialized when insensitive hash objects are deserialized using psych which is shipped with Ruby 2. Here is an example on Ruby 2.3.1p112:
Notice that this is not an issue on ruby 1.9.3p551:
I am using version 0.3.3 of this gem.
The text was updated successfully, but these errors were encountered: