2012-04-14 88 views
6

我试图使用Octopress(一个博客引擎的哲基尔的顶部)在我的新款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工作正常。

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

+0

很奇怪。也许尝试切换到[kramdown](http://kramdown.rubyforge.org/)而不是RDiscount? – Phrogz 2012-04-15 14:24:40

回答

3

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

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

+0

是的,我试过更新我的宝石(IIRC,我手动切换到RDiscount而不是玛鲁库,因为LaTeX支持,跟着一些jekyll <-> LaTeX指示,我跟着某处)。 – grautur 2012-04-24 18:33:11

1

的第一件事我会做的是检查所有的版本。 ruby -v,gem -v,gem list -d sinatra,gem list -d octopress。等等,并寻找差异。

0

我也有这个错误。我通过创建新的RVM gemset和重新运行软件包安装来解决此问题。

又见https://github.com/rtomayko/rdiscount/issues/66

$ rvm gemset create gaga 
'gaga' gemset created (/Users/chaffee/.rvm/gems/[email protected]). 
$ rvm use @gaga 
Using /Users/chaffee/.rvm/gems/ruby-1.9.3-p125 with gemset gaga 
$ bundle install 
... 
Installing rdiscount (1.6.8) with native extensions 
... 
$ irb 
>> require 'rdiscount' 
=> true 
>> RDiscount.new("hello").to_html 
=> "<p>hello</p>\n" 
相关问题