2012-04-14 87 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" 
相關問題