【问题标题】:jekyll serve throws 'no implicit conversion of Hash into Integer ' errorjekyll serve 抛出“没有将哈希隐式转换为整数”错误
【发布时间】:2021-02-09 05:47:02
【问题描述】:

我正在关注 Michael Hartl 的 Learn Enough CSS 课程。我当前的文件夹布局如下:

- _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。

谢谢!

【问题讨论】:

  • 我在您的github repo 中没有看到此代码,如果您可以提交它,它会有所帮助。同时,您能否将bundle exec jekyll build --trace 的输出添加到您的问题中。
  • @BradWest 感谢您的回复!原来我没有做gem install bundler,这就是为什么我对 jekyll 有问题!
  • 您使用的是较新版本的 ruby​​ 吗? x=> 3?

标签: jekyll


【解决方案1】:

引用此source:-

Github-Pages 使用 Jekyll 3.9,它与 Ruby 3 不兼容。 降级到 Ruby 2.7 应该可以避免这个问题。

这对我有用。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-04-03
  • 1970-01-01
  • 2023-04-02
  • 1970-01-01
  • 2015-02-06
  • 1970-01-01
  • 2023-04-09
相关资源
最近更新 更多