jekyll 3.9.0 |错误:没有将哈希隐式转换为整数 /var/lib/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read':没有隐式

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

更新到 Ubuntu 22.04 后,我的 Jekyll 失败了。

bundle exec jekyll serve
会产生此错误:

...
                  done in 8.248 seconds.
jekyll 3.9.0 | Error:  no implicit conversion of Hash into Integer
/var/lib/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read': no implicit conversion of Hash into Integer (TypeError)
    from /var/lib/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/utils/platforms.rb:75:in `proc_version'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/utils/platforms.rb:40:in `bash_on_windows?'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:77:in `watch'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:43:in `process'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `block in start'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `each'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `start'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
    from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /var/lib/gems/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /var/lib/gems/3.0.0/gems/jekyll-3.9.0/exe/jekyll:15:in `<top (required)>'
    from /usr/local/bin/jekyll:25:in `load'
    from /usr/local/bin/jekyll:25:in `<top (required)>'
    from /var/lib/gems/3.0.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:58:in `load'
    from /var/lib/gems/3.0.0/gems/bundler-2.3.15/lib/bundler/cli/exec.rb:58:in `kernel_load'
...
    from /var/lib/gems/3.0.0/gems/bundler-2.3.15/lib/bundler/cli.rb:25:in `start'
    from /var/lib/gems/3.0.0/gems/bundler-2.3.15/exe/bundle:48:in `block in <top (required)>'
    from /var/lib/gems/3.0.0/gems/bundler-2.3.15/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
    from /var/lib/gems/3.0.0/gems/bundler-2.3.15/exe/bundle:36:in `<top (required)>'
    from /usr/bin/bundle:25:in `load'
    from /usr/bin/bundle:25:in `<main>'

有什么建议如何解决这个问题吗?

jekyll 仓库:https://github.com/schmidb/TurtleTrafo

jekyll bundle
2个回答
2
投票

Ruby 3 可能是问题所在,请参阅:

第二个链接建议降级到 Ruby/Bundler 2.7

此线程中还有另一个有趣的信息:

4月26日 Jekyll v3.9.2最终删除了Jekyll对pathutil的主要依赖。现在 Github Pages 已更新到该版本的 Jekyll(请参阅https://github.com/github/pages-gem/pull/833),此问题不应再影响 Github Pages 或 Jekyll。

您的 Gemfile.lock 显示为 Jekyll 3.9.2,所以问题现在应该消失了。


0
投票

更新

github-pages
gem 后,这个问题得到了修复:

bundle update github-pages

以上假设已安装 Bundler(请参阅此处)。

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