Help with: Error: private method `include' called for Jekyll::Page:Class

I am not doing anything fancy here, just trying to run the documentation for bootstrap 4.

When I run the specified command $ bundle exec jekyll serve I consistently get this error:

jekyll 3.3.1 | Error: private method `include’ called for Jekyll::Page:Class

specs:
OSX 10.11.6
Ruby 2.3.1p112

The only info google turned up was this issue: https://github.com/jekyll/jekyll-redirect-from/issues/135 which only indicates the issue is resolved.

Any insight on how to resolve this would be appreciated.

Hi, Please answer the following two questions:

  1. What’s the version of jekyll-redirect-from you’re using?
  2. When you run $ bundle exec jekyll build --trace, what’s the console output?

Thanks for responding.

  1. jekyll-redirect-from 0.12.0

  2. Configuration file: /Users/me/Projects/bootstrap4/_config.yml
    bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
    NoMethodError: private method include' called for Jekyll::Page:Class /Library/Ruby/Gems/2.0.0/gems/jekyll-redirect-from-0.12.0/lib/jekyll-redirect-from.rb:16:inblock in <top (required)>’
    /Library/Ruby/Gems/2.0.0/gems/jekyll-redirect-from-0.12.0/lib/jekyll-redirect-from.rb:15:in each' /Library/Ruby/Gems/2.0.0/gems/jekyll-redirect-from-0.12.0/lib/jekyll-redirect-from.rb:15:in<top (required)>’
    /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/external.rb:43:in require' /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/external.rb:43:inblock in require_with_graceful_fail’
    /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/external.rb:40:in each' /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/external.rb:40:inrequire_with_graceful_fail’
    /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/plugin_manager.rb:27:in require_gems' /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/plugin_manager.rb:19:inconscientious_require’
    /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/site.rb:111:in setup' /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/site.rb:33:ininitialize’
    /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/commands/build.rb:28:in new' /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/commands/build.rb:28:inprocess’
    /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/lib/jekyll/commands/build.rb:16:in block (2 levels) in init_with_program' /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:incall’
    /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in block in execute' /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:ineach’
    /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in execute' /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:ingo’
    /Library/Ruby/Gems/2.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in program' /Library/Ruby/Gems/2.0.0/gems/jekyll-3.3.1/exe/jekyll:13:in<top (required)>’
    /usr/local/bin/jekyll:23:in load' /usr/local/bin/jekyll:23:in<top (required)>’

The very same issue, you posted a link to originally, has been fixed in the v0.12.1. Simply update the plugin and you should be fine…

  • To update the plugin globally:
$ gem update jekyll-redirect-from
# Note: After updating, delete the `Gemfile.lock` and build again. 
  • or directly from your project directory with a Gemfile:
$ bundle update jekyll-redirect-from

A

D’oh! Thank you for looking over my shoulder and pointing out what should have been obvious to me.

I’ll just go be quiet and run the update now…

Cheers!

1 Like