Skip to content

undefined method `include?' for nil:NilClass #197

@pelcasandra

Description

@pelcasandra

I want to report a bug:

What is the current behavior?

bundle exec jekyll algolia
Configuration file: /root/site/_config.yml
Processing site...                                                               
jekyll 4.3.1 | Error:  undefined method `include?' for nil:NilClass

        translate_posts = !site.config['exclude_from_localizations'].include?("_posts")
                                                                    ^^^^^^^^^
/root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-multiple-languages-plugin-1.8.0/lib/jekyll-multiple-languages-plugin.rb:251:in `read_posts': undefined method `include?' for nil:NilClass (NoMethodError)

        translate_posts = !site.config['exclude_from_localizations'].include?("_posts")
                                                                    ^^^^^^^^^
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-4.3.1/lib/jekyll/reader.rb:91:in `retrieve_posts'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-4.3.1/lib/jekyll/reader.rb:76:in `read_directories'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-4.3.1/lib/jekyll/reader.rb:16:in `read'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-4.3.1/lib/jekyll/site.rb:181:in `read'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-algolia-1.7.1/lib/jekyll/algolia/overwrites/jekyll-algolia-site.rb:23:in `process'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-algolia-1.7.1/lib/jekyll-algolia.rb:82:in `run'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-algolia-1.7.1/lib/jekyll/commands/algolia.rb:38:in `block (2 levels) in init_with_program'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/jekyll-4.3.1/exe/jekyll:15:in `<top (required)>'
	from /root/3.1.2/bin/jekyll:25:in `load'
	from /root/3.1.2/bin/jekyll:25:in `<top (required)>'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `load'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:23:in `run'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli.rb:486:in `exec'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli.rb:31:in `dispatch'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/cli.rb:25:in `start'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/exe/bundle:48:in `block in <top (required)>'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /root/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.22/exe/bundle:36:in `<top (required)>'
	from /root/3.1.2/bin/bundle:25:in `load'
	from /root/3.1.2/bin/bundle:25:in `<main>'

What is your expected behavior?

I would expect it to create index the pages into algolia.

Git repository to reproduce the issue:

https://github.com/hellotext/help

Ruby version used:

ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]

Jekyll version used:

jekyll 4.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions