gpt4 book ai didi

jekyll 服务抛出 'no implicit conversion of Hash into Integer ' 错误

转载 作者:行者123 更新时间:2023-12-05 02:45:07 28 4
gpt4 key购买 nike

我正在学习 Michael Hartl 的 Learn Enough CSS 类(class)。我当前的文件夹布局如下:

- _layouts
- _site
index.html

index.html 是:

---
layout: test
---

我在 _layouts 中有 test.html 作为:

Hello again, world.

每当我运行 jekyll serve 时,我都会收到此错误:

Error reading file /Users/pj/Documents/LETGD/repos/pohjie.github.io/_layouts/test.html: no implicit conversion of Hash into Integer 
Error reading file /Users/pj/Documents/LETGD/repos/pohjie.github.io/index.html: no implicit conversion of Hash into Integer

有人知道发生了什么事吗?我使用的是 M1 MacBook,不确定这是否是可能的原因,因为我也花了很多时间安装 Ruby。

谢谢!

最佳答案

虽然降级确实有效,但它可能非常烦人并且(取决于您需要它的地方)有问题。如果您只想要一个简单的解决方法,您可以利用 jekyll build 仍然适用于 Ruby 3 的事实,并且只单独提供页面:

bundler exec jekyll build && bash -c 'cd _site && python -m http.server 3000'

唯一的缺点是你失去了自动重新加载。如果你改变了什么,你需要重启 jekyll。但是您可以在 Ruby 3 环境中运行它,而无需摆弄环境本身。

关于jekyll 服务抛出 'no implicit conversion of Hash into Integer ' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66113639/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com