完整的錯誤信息如下:
LinkChecker: [Warning] done in 13.838 seconds. Auto-regeneration: enabled for 'D:/WorkDir/Repository/GitHub/opensearch/documentation-website' ------------------------------------------------ Jekyll 4.2.1 Please append `--trace` to the `serve` command for any additional information or backtrace. ------------------------------------------------ D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError) from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:179:in `require_relative' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:179:in `setup' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:100:in `process' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program' from D:/DKits/Ruby/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>' from D:/DKits/Ruby/bin/jekyll:23:in `load' from D:/DKits/Ruby/bin/jekyll:23:in `<main>'
問題和解決
根據官方的項目的說明:
這是因為:
從 Ruby 3.0 開始 webrick 已經不在綁定到 Ruby 中了,請參考鏈接: Ruby 3.0.0 Released 中的說明。
webrick 需要手動進行添加。
添加的命令為:
bundle add webrick
后就可以解決這個問題了。
https://www.ossez.com/t/jekyll-cannot-load-such-file-webrick-loaderror/13779

