我正在尝试使用 Octopress (Jekyll 之上的博客引擎)在我的新 Macbook 上,当我运行 bundle exec jekyll --server
时出现此错误:
(缩短路径)
/path/to/markdown.rb:118:in `to_html': wrong argument type String (expected Array) (TypeError)
from /path/to/markdown.rb:118:in `convert'
...
(完整路径)
/usr/local/rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/converters/markdown.rb:118:in `to_html': wrong argument type String (expected Array) (TypeError)
from /usr/local/rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/converters/markdown.rb:118:in `convert'
...
查看第 118 行,我看到:
RDiscount.new(content, *@rdiscount_extensions).to_html
如果我将这一行替换为“hello”之类的字符串,服务器将正常启动。但是如果我用 RDiscount.new("hello").to_html
之类的东西替换它,我会得到同样的错误。但是,启动 irb 并运行 RDiscount.new("hello").to_html
工作正常。
有什么问题吗?我可以在我拥有的另一台计算机上启动服务器,但我不确定如何找出两台计算机正在执行的操作之间的区别(某处某个库的不同版本?)。
最佳答案
只是一个想法,但您是否尝试过更新您的 gemset? jekyll 的最新版本是 0.11.2,它默认使用 maruku 而不是 RDiscount。
关于ruby - 错误的参数类型字符串(应为数组),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10152053/