ruby - 错误的参数类型字符串(应为数组)

标签 ruby sinatra jekyll jekyll-extensions

我正在尝试使用 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。

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

关于ruby - 错误的参数类型字符串(应为数组),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10152053/

相关文章:

ruby - 如何使用 Ruby 1.9.3 在 Aptana 3 中获得调试支持?

ruby - 获取 Padrino 辅助方法的 NoMethodError

Ruby 使用多线程运行两个脚本

ruby - Ruby Datamapper 如何在同一应用程序中使用不同的数据存储

ruby - Rack Session Cookie 和 Sinatra - 设置和访问数据

ruby - 输出液体模板中的可用对象和属性

ruby-on-rails - NameError : undefined local variable or method `remember_digest and NoMethodError

Jekyll服务突然从localhost切换到0.0.0.0-可以解决吗?

Jekyll 帖子摘录 : How to remove the first paragraph

ruby-on-rails - 将 Sidekiq 升级到 v6 后,它不会在生产环境中自动启动