ruby can't dump hash with default proc

Developer from somewhere

Received the error ruby can’t dump hash with default proc. It was raised by a 3rd party lib, that was using

1
Marshal.dump
. Turns out, I had a hash defined like this:

hash = Hash.new{|h,k| h[k] = []}

The fix was to remove the initialization block, and instead use it like this in my code:

hash[some_value] ||= []
hash[some_value] << some_other_value