avillafiorita / jekyll-datapage_gen

Generate one page per yaml record in Jekyll sites.
367 stars 79 forks source link

Doesn't seem to work with Jekyll 4.2.0 #95

Closed tkrunning closed 3 years ago

tkrunning commented 3 years ago

With jekyll-datapage-generator installed I get the following error when running jekyll s --trace:

 Incremental build: disabled. Enable with --incremental
      Generating...
bundler: failed to load command: jekyll (/usr/local/lib/ruby/gems/3.0.0/bin/jekyll)
/usr/local/lib/ruby/gems/3.0.0/gems/jekyll-datapage-generator-1.3.0/lib/jekyll-datapage-generator.rb:170:in `block in generate': undefined method `each' for nil:NilClass (NoMethodError)
    from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-datapage-generator-1.3.0/lib/jekyll-datapage-generator.rb:132:in `each'
    from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-datapage-generator-1.3.0/lib/jekyll-datapage-generator.rb:132:in `generate'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:193:in `block in generate'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:191:in `each'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:191:in `generate'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/site.rb:79:in `process'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:28:in `process_site'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:65:in `build'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/build.rb:36:in `process'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
    from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
    from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
    from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
    from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
    from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
    from /usr/local/lib/ruby/gems/3.0.0/bin/jekyll:23:in `load'
    from /usr/local/lib/ruby/gems/3.0.0/bin/jekyll:23:in `<top (required)>'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/cli/exec.rb:63:in `load'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/cli/exec.rb:63:in `kernel_load'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/cli/exec.rb:28:in `run'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/cli.rb:494:in `exec'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/cli.rb:30:in `dispatch'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/cli.rb:24:in `start'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/exe/bundle:49:in `block in <top (required)>'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    from /Users/tkrunning/.gem/ruby/3.0.0/gems/bundler-2.2.10/exe/bundle:37:in `<top (required)>'
    from /usr/local/opt/ruby/bin/bundle:23:in `load'
    from /usr/local/opt/ruby/bin/bundle:23:in `<main>'

Removing the plugin from _config.yml and Gemfile solves the issue, but then obviously I can't use the plugin...

Any idea if this is a general compatibility issue or a local issue on my machine?

avillafiorita commented 3 years ago

The issue seems to be with an empty data structure, rather than with the way in which you installed the plugin (i.e, putting the source in _config, rather than installing the gem).

Did you configure how to read the data (in _config.yml) and is the data correct (e.g, each record has the field specified in _config.yml)?

You can set debug: true in _config.yml (under the data you want to check) to have datapage-generator be more informative about what is causing the trouble (see https://github.com/avillafiorita/jekyll-datapage_gen#usage, the last field)

Hope it helps, let me know if it works.

-----Original Message----- From: Thomas K. Running notifications@github.com Reply-To: avillafiorita/jekyll-datapage_gen reply@reply.github.com To: avillafiorita/jekyll-datapage_gen jekyll-datapage_gen@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [avillafiorita/jekyll-datapage_gen] Doesn't seem to work with Jekyll 4.2.0 (#95) Date: Tue, 16 Feb 2021 05:15:48 -0800

/usr/local/lib/ruby/gems/3.0.0/gems/jekyll-datapage-generator-1.3.0/lib/jekyll-datapage-generator.rb:170:in block in generate': undefined methodeach' for nil:NilClass (NoMethodError)

-- Adolfo Villafiorita http://ict4g.fbk.eu adolfo@ict4g.net - +39 349 6204514

tkrunning commented 3 years ago

For some reason, it started working again without throwing the error... Without me changing anything (just running bundle install once more). It's possible that the issue was related to the jekyll-get-json plugin, as the data being used by jekyll-datapage_gen is being pulled by that plugin (it's not stored in the _data dir).

Thanks for getting back to me so quickly, and sorry for the false alarm!

Edit: somehow it seems Ruby got downgraded to 2.7 and that solved the issue.

Edit2: In case anyone else runs into this issue, it was indeed the jekyll-get-json plugin that needed to be updated to 1.0.0 in order to work with Ruby 3.0.