Error when executing bundle install

C:\Users\Dani\jekyll-klise>bundle exec jekyll serve
jekyll 4.1.1 | Error:  undefined method `[]' for nil
C:/Ruby33-x64/lib/ruby/3.3.0/logger.rb:384:in `level': undefined method `[]' for nil (NoMethodError)

    @level_override[Fiber.current] || @level
                   ^^^^^^^^^^^^^^^
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-4.1.1/lib/jekyll/log_adapter.rb:45:in `adjust_verbosity'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-4.1.1/lib/jekyll/configuration.rb:143:in `config_files'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-4.1.1/lib/jekyll.rb:118:in `configuration'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:44:in `configuration_from_options'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-4.1.1/lib/jekyll/commands/serve.rb:83:in `block (2 levels) in init_with_program'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-4.1.1/exe/jekyll:15:in `<top (required)>'
        from C:/Ruby33-x64/bin/jekyll:25:in `load'
        from C:/Ruby33-x64/bin/jekyll:25:in `<main>'

C:\Users\Dani\jekyll-klise>

can you share the repo ?

try to run this repo, show me some error.

jekyll 4.3.3
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x64-mingw-ucrt]
Bundler version 2.5.4
gem 3.5.3
window 10

D:\ruby\website>bundle exec jekyll serve -l
jekyll 3.9.3 | Error:  undefined method `[]' for nil
C:/Ruby33-x64/lib/ruby/3.3.0/logger.rb:384:in `level': undefined method `[]' for nil (NoMethodError)

    @level_override[Fiber.current] || @level
                   ^^^^^^^^^^^^^^^
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-3.9.3/lib/jekyll/log_adapter.rb:43:in `adjust_verbosity'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-3.9.3/lib/jekyll/configuration.rb:157:in `config_files'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-3.9.3/lib/jekyll.rb:113:in `configuration'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-3.9.3/lib/jekyll/command.rb:43:in `configuration_from_options'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:89:in `start'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        from C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/jekyll-3.9.3/exe/jekyll:15:in `<top (required)>'
        from C:/Ruby33-x64/bin/jekyll:32:in `load'
        from C:/Ruby33-x64/bin/jekyll:32:in `<main>'

I hit a similar error and downgrading from Ruby 3.3.0 to Ruby 3.2.2 fixed the problem for me.

I’m running Jekyll 4.3.2.

If you can, upgrade to Jekyll 4.3.3 and try again with Ruby 3.3.0. The release notes suggest your problem should be fixed there.

1 Like

I had this same issue and upgrading to Jekyll 4.3.3 fixed it. Thanks!

I also had this issue, and after banging my head against a wall for >1 hour, I realized that downgrading to Ruby 3.2.3 fixed it. But weirdly I had some issue when re-installing ruby with brew, and I ran in some strange errors in terminal when running bundle.

I decided to use chruby instead to manage ruby version, going ahead. I published a post on medium that go into more detail, if anyone’s curious. This is what ended up working for me.

is that right?? I think you mean 3.3.2?

Crap yeah, good catch. I meant 3.2.3. Sometimes the numbers are very easy to confuse.

Edit: fixed it, thanks.