wrong argument type String (expected Array)
Asked Answered
C

3

6

I'm trying to use Octopress (a blogging engine on top of Jekyll) on my new Macbook, and I get this error when I run bundle exec jekyll --server:

(shortened path)

/path/to/markdown.rb:118:in `to_html': wrong argument type String (expected Array) (TypeError)
from /path/to/markdown.rb:118:in `convert'
...

(full path)

/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'
...

Looking at line 118, I see:

RDiscount.new(content, *@rdiscount_extensions).to_html

If I replace this line with a string like "hello", the server starts fine. But if I replace it with something like RDiscount.new("hello").to_html, I get the same error. However, launching irb and running RDiscount.new("hello").to_html works fine.

Any ideas what's wrong? I'm able to launch the server on another computer I have, but I'm not sure how to figure out what's the difference between what the two computers are doing (a different version of some library somewhere?).

Centum answered 14/4, 2012 at 8:1 Comment(1)
Very odd. Perhaps try switching to kramdown instead of RDiscount?Hazen
B
3

Just a thought, but have you tried updating your gemset? The most recent version of jekyll is 0.11.2 and it uses maruku by default instead of RDiscount.

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

Bambibambie answered 18/4, 2012 at 15:19 Comment(1)
Yep, I've tried updating my gems (IIRC, I manually switched to RDiscount instead of Maruku because of LaTeX support, following some jekyll<->LaTeX instructions I followed somewhere).Centum
P
1

First thing i'd do is check all the versions. ruby -v , gem -v, gem list -d sinatra , gem list -d octopress. etc and look for differences.

Pestle answered 23/4, 2012 at 9:10 Comment(0)
M
0

I was having this error too. I solved it by creating a new RVM gemset and rerunning bundle install.

See also https://github.com/rtomayko/rdiscount/issues/66

$ rvm gemset create gaga
'gaga' gemset created (/Users/chaffee/.rvm/gems/ruby-1.9.3-p125@gaga).
$ 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"
Marley answered 21/5, 2012 at 21:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.