将 Jekyll 更新到 1.2.1 后,运行我的博客时出现此错误:
Generating... Liquid Exception: can't convert String into Integer in _posts/ru/issues/2009-06-21-xpath-prime-numbers.md
痕迹指的是液体中对我没有任何意义的地方:
/Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/standardfilters.rb:108:in `[]': can't convert String into Integer (TypeError)
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/standardfilters.rb:108:in `map'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/standardfilters.rb:102:in `map'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/strainer.rb:43:in `send'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/strainer.rb:43:in `invoke'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/context.rb:82:in `invoke'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/variable.rb:102:in `render'
from /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:53:in `inject'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/variable.rb:90:in `each'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/variable.rb:90:in `inject'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/variable.rb:90:in `render'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/block.rb:137:in `render_all'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/block.rb:124:in `each'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/block.rb:124:in `render_all'
from /Library/Ruby/Gems/1.8/gems/liquid-2.5.2/lib/liquid/tags/if.rb:34:in `render'
...
谷歌搜索后,我从不同的 ruby 开发人员那里得到了一些类似问题的解释。但没有一个是关于杰基尔的。在这里,我无法更改 Jekyll 代码,只能修复我博客中的某些内容。我不明白到底是什么。
UPD:我刚刚发现使用 { array | 时出现错误 map: smth} 在我的模板中。smth 是一个字符串。