Skip to content

[Bug]: bundle exec jekyll liveserve cannot work [ERROR NoMethodError: undefined method `key?' for nil:NilClass] #9451

Closed as not planned

Description

@ERICXUCHI

Operating System

20.04.1-Ubuntu

Ruby Version

ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]

Jekyll Version

jekyll 3.9.3

GitHub Pages Version

github-pages 228

Expected Behavior

I expected my web should run successfully when I ran bundle exec jekyll liveserve

Current Behavior

I cannot open localhost:4000 and Error:

image

Relevant log output

[2023-09-25 10:24:50] ERROR NoMethodError: undefined method `key?' for nil:NilClass
        /var/lib/gems/2.7.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve/servlet.rb:191:in `conditionally_inject_charset'
        /var/lib/gems/2.7.0/gems/jekyll-3.9.3/lib/jekyll/commands/serve/servlet.rb:176:in `do_GET'
        /var/lib/gems/2.7.0/gems/hawkins-2.0.5/lib/hawkins/servlet.rb:134:in `do_GET'
        /usr/lib/ruby/2.7.0/webrick/httpservlet/abstract.rb:105:in `service'
        /usr/lib/ruby/2.7.0/webrick/httpservlet/filehandler.rb:233:in `service'
        /usr/lib/ruby/2.7.0/webrick/httpserver.rb:140:in `service'
        /usr/lib/ruby/2.7.0/webrick/httpserver.rb:96:in `run'
        /usr/lib/ruby/2.7.0/webrick/server.rb:307:in `block in start_thread'


### Code Sample

Here is my all code: 
https://github.com/ERICXUCHI/ERICXUCHI.github.io#to-run-locally-not-on-github-pages-to-serve-on-your-own-computer
 

Activity

  1. duckinator commented on Oct 10, 2023

    @duckinator

    jekyll liveserve was added by a now-unmaintained Jekyll plugin ("Hawkins"), but the functionality got merged into Jekyll back in 2017. You should use jekyll serve -l (short for jekyll serve --livereload) instead.

  2. libricardo commented on Nov 7, 2023

    @libricardo

    @duckinator Thanks, it works by bundle exec jekyll serve -l !!!

  3. minhaj6 commented on Feb 6, 2024

    @minhaj6
  4. locked and limited conversation to collaborators on Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions