Skip to content

Conversation

@TheStranjer
Copy link
Contributor

When I try to run:

ruby -e 'require "jekyll-import";
    JekyllImport::Importers::WordPress.run({
    # . . .
    })'

Per the instructions found here.

It throws this error:

Traceback (most recent call last):
	4: from -e:2:in `<main>'
	3: from /home/thestranjer/Code/jekyll-import/lib/jekyll-import/importer.rb:22:in `run'
	2: from /home/thestranjer/Code/jekyll-import/lib/jekyll-import/importer.rb:15:in `stringify_keys'
	1: from /home/thestranjer/Code/jekyll-import/lib/jekyll-import/importer.rb:15:in `each_key'
/home/thestranjer/Code/jekyll-import/lib/jekyll-import/importer.rb:16:in `block in stringify_keys': can't add a new key into hash during iteration (RuntimeError)

This is because in the JekyllImport::Importer::stringify_keys method, it is trying to edit the hash as it iterates over itself. This pull request fixes that.

@DirtyF
Copy link
Member

DirtyF commented May 21, 2020

@jekyll: merge +fix

@jekyllbot jekyllbot merged commit c333d71 into jekyll:master May 21, 2020
jekyllbot added a commit that referenced this pull request May 21, 2020
@TheStranjer TheStranjer deleted the no_new_keys_in_iteration branch May 21, 2020 16:30
@jekyll jekyll locked and limited conversation to collaborators May 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants