【发布时间】:2023-04-09 06:30:01
【问题描述】:
我已经用这个错误搜索了 jekyll。jekyll 处理页面时似乎出现了 ruby 错误,但我根本不懂 ruby。
jekyll 版本 1.3.1
我什至重新安装了 ruby 和 jekyll,但结果没有改变。
更新:
在我将 jekyll 从 1.31 降级到 1.20 后,此错误消失了
注意:我的网站是用 jekyll 1.20 创建的,所以它不能用 1.3.1 构建?这是核心问题吗?
E:\GitHub\sample>jekyll serve --trace :
Configuration file: E:/GitHub/sample/_config.yml
Source: E:/GitHub/sample
Destination: E:/GitHub/sample/_site
Generating... D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/page.rb:127:in `join': no implicit conversion of nil int
o String (TypeError)
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/page.rb:127:in `relative_path'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/page.rb:122:in `path'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/generators/pagination.rb:118:in `pagination_candidate?'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/generators/pagination.rb:77:in `block in template_page'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/generators/pagination.rb:76:in `select'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/generators/pagination.rb:76:in `template_page'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/generators/pagination.rb:17:in `generate'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb:229:in `block in generate'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb:228:in `each'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb:228:in `generate'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/site.rb:38:in `process'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/command.rb:18:in `process_site'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/commands/build.rb:23:in `build'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/lib/jekyll/commands/build.rb:7:in `process'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/jekyll-1.3.1/bin/jekyll:97:in `block (2 levels) in <top (required)>'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:180:in `call'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/command.rb:155:in `run'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:402:in `run_active_command'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/runner.rb:78:in `run!'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/delegates.rb:7:in `run!'
from D:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.1.5/lib/commander/import.rb:10:in `block in <top (required)>'
更新测试样本
test repo
从 1.20 到 1.30 完美运行,从 1.3.1 到 1.4.3 崩溃。
【问题讨论】:
-
我降级到 1.3.0 并且问题对我来说也消失了。我一直在运行 1.4.2
-
当我有一个空白配置文件时,我个人遇到了这个问题。这是一个相关的 jekyll 错误报告:github.com/jekyll/jekyll/issues/1705
-
升级后我也遇到了这个问题。我发现我的一个页面有语法错误。
-
@Mithril 您能否将您的代码更新到 github 存储库,以便我们查看问题所在?
-
@Agis 你可以在github.com/kmithril/test 看到repo。我测试了最新的jekyll,但同样的错误。