Jekyll 3.9.0 |错误:没有隐含的哈希转换为integer/var/lib/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:In阅读':

发布于 2025-02-06 14:04:21 字数 2687 浏览 2 评论 0 原文

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

Bundle exec jekyll服务创建此错误:

...
                  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 repo: https://github.com/schmidb/turtletrafo

after update to Ubuntu 22.04 I am failing with Jekyll.

bundle exec jekyll serve creates this error:

...
                  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>'

Any advice how to fix this?

jekyll repo: https://github.com/schmidb/TurtleTrafo

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云柯 2025-02-13 14:04:21

Ruby 3可能是问题,请参见:

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

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

4月26日
Jekyll v3.9.2最终取消了Jekyll对Pathutil的主要依赖。现在,github页面已更新到该版本的jekyll(请参阅 https://github.com/ github/pages-gem/plup/833 ),此问题不再影响github页面或jekyll。

您的gemfile.lock说jekyll 3.9.2,所以问题现在应该消失了。

Ruby 3 may be the problem, see:

The second link suggests downgrading to Ruby/Bundler 2.7

There is another interesting info in this thread:

on 26 Apr
Jekyll v3.9.2 finally removed Jekyll's main dependency on pathutil. Now that Github Pages updated to that version of Jekyll (see https://github.com/github/pages-gem/pull/833), this issue shouldn't affect Github pages or Jekyll anymore.

Your Gemfile.lock says Jekyll 3.9.2 so the issue should be gone now.

去了角落 2025-02-13 14:04:21

This got fixed for me after updating the github-pages gem:

bundle update github-pages

The above assumes Bundler is installed (see here).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文