• Jekyll 运行的时候提示错误 cannot load such file -- webrick (LoadError)


    完整的错误信息如下:

    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

  • 相关阅读:
    JavaBean 与 EJB 的区别
    MFC选项卡的实现
    MFC的图片按钮
    windows 下使用 MinGW + msys 编译 ffmpeg
    在windows使用vs2008编译live555
    C89 和 C99 标准比较
    11.求二元查找树的镜像[MirrorOfBST]
    10.排序数组中和为给定值的两个数字[Find2NumbersWithGivenSum]
    9.链表中倒数第k个结点[FindReverseKthLinkedListNode]
    8.另类方法求1+2+...+n[AnotherMethodOfCalculateSumN]
  • 原文地址:https://www.cnblogs.com/huyuchengus/p/15473035.html
Copyright © 2020-2023  润新知