错误的参数类型String(期望的数组)

gra*_*tur 6 ruby sinatra jekyll jekyll-extensions

我正试图在我的新Macbook上使用Octopress(Jekyll上的博客引擎),当我运行时出现这个错误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'
...
Run Code Online (Sandbox Code Playgroud)

(完整路径)

/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'
...
Run Code Online (Sandbox Code Playgroud)

看看第118行,我看到:

RDiscount.new(content, *@rdiscount_extensions).to_html
Run Code Online (Sandbox Code Playgroud)

如果我用"hello"这样的字符串替换这一行,服务器就可以正常启动了.但如果我用类似的东西替换它RDiscount.new("hello").to_html,我会得到同样的错误.但是,启动irb和运行RDiscount.new("hello").to_html工作正常.

有什么想法有什么不对吗?我能够在我拥有的另一台计算机上启动服务器,但我不知道如何弄清楚这两台计算机正在做什么之间的区别(某个库的某个版本不同?).

小智 3

只是一个想法,但是您尝试过更新您的宝石集吗?jekyll 的最新版本是 0.11.2,它默认使用 maruku 而不是 RDiscount。

https://github.com/mojombo/jekyll/wiki/Install