Invalid String argument type (expected array)

I try to use Octopress (the blog 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 hello line, the server will start normally. But if I replace it with something like RDiscount.new("hello").to_html , I get the same error. However, starting irb and starting RDiscount.new("hello").to_html .

Any ideas what's wrong? I can start the server on another computer that I have, but I'm not sure how to understand the difference between what these two computers do (is there a different version of some library somewhere?).

+6
source share
3 answers

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

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

+3
source

The first thing I would do is check all the versions. ruby -v, gem -v, gem list -d sinatra, gem list -d oktopress. etc. and look for differences.

+1
source

I also had this error. I solved this by creating a new installation of RVM gemset and reerunning 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" 
0
source

Source: https://habr.com/ru/post/913186/


All Articles