使用'map'过滤集合时,液体模板会掉落

时间:2013-10-06 20:30:28

标签: ruby jekyll liquid

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

谷歌搜索后,我从不同的红宝石开发者那里得到了一些类似问题的解释。但他们都不是关于杰基尔的。 在这里,我无法更改Jekyll代码,只能在我的博客中修改一些内容。我不明白到底是什么。

UPD:我刚发现使用{array |时出现错误map:smth}在我的模板中。 smth是一个字符串。

0 个答案:

没有答案