升级 Jekyll 4 损坏 - sitemap_generator.rb:129:in `block in fill_pages': undefined method `exists?'对于文件:类(NoMethodError)

问题描述 投票:0回答:1

Hi 将我的安装升级到 4.0,它完全破坏了我的设置 我在 MacOS、ruby 3.2.0、Jekyll 4.0.1 上运行

Using public_suffix 4.0.6
Using addressable 2.7.0
Using bundler 2.1.4
Using colorator 1.1.0
Using concurrent-ruby 1.1.7
Using eventmachine 1.2.7
Using http_parser.rb 0.6.0
Using em-websocket 0.5.2
Using ffi 1.13.1
Using forwardable-extended 2.6.0
Using i18n 1.8.5
Using sassc 2.4.0
Using jekyll-sass-converter 2.1.0
Using rb-fsevent 0.10.4
Using rb-inotify 0.10.1
Using listen 3.3.3
Using jekyll-watch 2.2.1
Using rexml 3.2.4
Using kramdown 2.3.0
Using kramdown-parser-gfm 1.1.0
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Using rouge 3.25.0
Using safe_yaml 1.0.5
Using unicode-display_width 1.7.0
Using terminal-table 1.8.0
Fetching jekyll 4.0.1
Installing jekyll 4.0.1
Using jekyll-feed 0.15.1
Using jekyll-seo-tag 2.7.1
Using minima 2.5.1
**MacBook-Pro:$ bundle exec jekyll serve**
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
    Configuration file: _config.yml
       Source: /Users/Documents/www.xxxxxx.com
       Destination: /Users/Documents/www.xxxxxxx.com/_site
     Incremental build: disabled. Enable with --incremental
          Generating... 
           Jekyll Feed: Generating feed for posts
                        ------------------------------------------------
          Jekyll 4.0.1   Please append `--trace` to the `serve` command 
                         for any additional information or backtrace. 
                        ------------------------------------------------
    /_plugins/sitemap_generator.rb:129:in `block in fill_pages': undefined method `exists?' for File:Class (NoMethodError)
    
              if File.exists?(page.path)
                     ^^^^^^^^
    Did you mean?  exist?
        from /_plugins/sitemap_generator.rb:127:in `each'
        from _plugins/sitemap_generator.rb:127:in `fill_pages'
        from _plugins/sitemap_generator.rb:84:in `generate'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/site.rb:185:in `block in generate'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/site.rb:183:in `each'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/site.rb:183:in `generate'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/site.rb:75:in `process'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/command.rb:28:in `process_site'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/commands/build.rb:65:in `build'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/commands/build.rb:36:in `process'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/command.rb:89:in `each'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
        from /usr/local/lib/ruby/gems/3.2.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
        from /usr/local/lib/ruby/gems/3.2.0/gems/jekyll-4.0.1/exe/jekyll:15:in `<top (required)>'
        from /usr/local/lib/ruby/gems/3.2.0/bin/jekyll:25:in `load'
        from /usr/local/lib/ruby/gems/3.2.0/bin/jekyll:25:in `<top (required)>'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
        from /usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
        from /Users//.gem/ruby/2.7.0/bin/bundle:23:in `load'
        from /Users//.gem/ruby/2.7.0/bin/bundle:23:in `<main>'

除了升级之外没有任何改变,当我运行 bundle exec Jekyll serve 或 build 时,它会抛出上面的错误。

谢谢

macos jekyll
1个回答
0
投票

我知道的不多,但如果你正确地编写了代码,它会说明它为什么不起作用,而实际上它确实起作用了。你必须尝试重新安装应用程序,甚至重新启动你的电脑,看看发生了什么🛜

© www.soinside.com 2019 - 2024. All rights reserved.