Skip to content

Jekyll serve fails on Ruby 3.0 (webrick missing) #752

Description

@Krinkle

This issue affects

  • The site generated by GitHub Pages
  • Building sites locally

What did you do (e.g., steps to reproduce)

bundle exec jekyll serve

On macOS 10.15 with Ruby 3.0.0 from Homebrew, using the latest github-pages in a Gemfile.

# Gemfile
gem "github-pages"

# Gemfile.lock:
    github-pages (209)
      jekyll (= 3.9.0)
…

What happened instead?

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-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:184:in `require_relative'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:184:in `setup'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:102:in `process'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `block in start'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `each'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `start'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.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 /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `load'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `kernel_load'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli/exec.rb:28:in `run'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli.rb:497:in `exec'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli.rb:30:in `dispatch'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli.rb:24:in `start'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.0.0/bin/bundle:23:in `load'
	from /usr/local/lib/ruby/gems/3.0.0/bin/bundle:23:in `<main>'

Additional information

Reported upstream at jekyll/jekyll#8523. Upstream has fixed this in the main branch for the next Jekyll 4 release, however this is unlikely to benefit GitHub Pages anytime soon, so it might be good to add this here for the time being.

Activity

  1. nllerandi3lift commented on Jan 21, 2021

    @nllerandi3lift
  2. parkr commented on Jan 21, 2021

    @parkr
    Contributor

    Hi! In general, we recommend (and support) running the github-pages gem with the Ruby version we're running in production (2.7.x). We don't yet support Ruby 3.0.0. Ruby 2.7.x still has webrick so I'd recommend using that until we've upgraded for your GitHub Pages needs!

  3. adamfg commented on Feb 7, 2021

    @adamfg

    Hi! In general, we recommend (and support) running the github-pages gem with the Ruby version we're running in production (2.7.x). We don't yet support Ruby 3.0.0. Ruby 2.7.x still has webrick so I'd recommend using that until we've upgraded for your GitHub Pages needs!

    This really should be in the official documentation: it's severely lacking small details like this that takes hours digging around to figure out.

    Totally. What a way to waste a Sunday trying to solve this after doing the responsible thing and using latest Ruby...

  4. jp26jp commented on Feb 26, 2021

    @jp26jp

    Definitely needs to be added to the documentation.

  5. ddnexus commented on Mar 5, 2021

    @ddnexus

    Definitely needs to be upgraded to support Ruby 3.0

  6. added a commit that references this issue on Mar 18, 2021
  7. Y2Data commented on Mar 18, 2021

    @Y2Data

    bundle add webrick

    This saved me while I was trying to run "bundle exec jekyll serve"

  8. pradyunsg commented on Apr 3, 2021

    @pradyunsg

    Can we add the information about what is the current version of Ruby being used to build Github pages to the README?

  9. parkr commented on Apr 3, 2021

    @parkr
    Contributor

    All of the latest versions we're running on GitHub Pages are shown here: https://pages.github.com/versions/

    There's even a JSON endpoint: https://pages.github.com/versions.json

    I wrote a blog post a while back about staying up to date by using that endpoint. Not sure how well it works today but you could add to your gemfile:

    ruby versions["ruby"]
    

    This will tell bundler to use the ruby version that GitHub Pages uses.

  10. parkr commented on Apr 3, 2021

    @parkr
    Contributor

    If anyone would like to submit a PR to update the README, I'd be happy to review. I'll try to update the README soon if not.

  11. adrienjoly commented on Jun 5, 2021

    @adrienjoly

    As suggested in imagej/imagej.github.io#133, adding gem 'webrick' to Gemfile fixed the problem on my end. Thank you!

  12. added a commit that references this issue on Jun 10, 2021
  13. 42 remaining items

  14. added a commit that references this issue on Dec 29, 2023
  15. added a commit that references this issue on Jan 13, 2024
  16. added a commit that references this issue on Jun 2, 2024
  17. Jazzyjgirl1976 commented on Jun 16, 2025

    @Jazzyjgirl1976

    This issue affects

    • The site generated by GitHub Pages
    • Building sites locally

    What did you do (e.g., steps to reproduce)

    bundle exec jekyll serve
    

    On macOS 10.15 with Ruby 3.0.0 from Homebrew, using the latest github-pages in a Gemfile.

    # Gemfile
    gem "github-pages"
    
    # Gemfile.lock:
        github-pages (209)
          jekyll (= 3.9.0)
    …
    

    What happened instead?

    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-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:184:in `require_relative'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:184:in `setup'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:102:in `process'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `block in start'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `each'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `start'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    	from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-3.9.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 /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `load'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `kernel_load'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli/exec.rb:28:in `run'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli.rb:497:in `exec'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli.rb:30:in `dispatch'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/cli.rb:24:in `start'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
    	from /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'
    	from /usr/local/lib/ruby/gems/3.0.0/bin/bundle:23:in `load'
    	from /usr/local/lib/ruby/gems/3.0.0/bin/bundle:23:in `<main>'
    

    Additional information

    Reported upstream at jekyll/jekyll#8523. Upstream has fixed this in the main branch for the next Jekyll 4 release, however this is unlikely to benefit GitHub Pages anytime soon, so it might be good to add this here for the time being.

  18. added a commit that references this issue on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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