#33 ✓resolved
Michael MacDonald

Error with Ruby 1.9.2 - Can't add a new key into hash during iteration

Reported by Michael MacDonald | October 11th, 2010 @ 01:15 AM

Hi Ian,

Running Pickle with Ruby 1.9.2 and I encountered this error:

can't add a new key into hash during iteration (RuntimeError)
/Users/michaelm/.rvm/gems/ruby-1.9.2-p0/gems/pickle-0.3.5/lib/pickle/session.rb:164:in `[]='

Initially it was with pickle 0.3.5 but it still exists with version 0.4.2. It occurs when I'm using an association (in Session#convert_models_to_attributes) eg:

Then a placement should exist with registration: the registration

Apparently it is a bug/feature with Ruby 1.9.2. I mimicked another person's workaround and it worked, see: http://github.com/remvee/exifr/commit/597f935cb2c251fd2792101fcaf99...

I can submit this change if you want but I wasn't sure whether this method/approach will still be in the new pickle changes you're making.

Cheers,

Michael.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Assign tickets to <b>Ian White</b>, so I get notified

People watching this ticket

Referenced by

Pages