使用 pandoc-ruby(直接来自文档)运行以下脚本时,出现错误。
require 'rubygems'
require 'pandoc-ruby'
puts PandocRuby.convert('# Markdown Title', :from => :markdown, :to => :html)
输出:
[dan@FIOS-RH test-markdown]$ ruby convert.rb
/usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:250:in `format_flag': undefined method `length' for :from:Symbol (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:241:in `create_option'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:225:in `prepare_options'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `inject'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:222:in `each'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:222:in `inject'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:222:in `prepare_options'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:227:in `prepare_options'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `inject'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:222:in `each'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:222:in `inject'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:222:in `prepare_options'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:131:in `convert'
from /usr/lib/ruby/gems/1.8/gems/pandoc-ruby-0.7.4/lib/pandoc-ruby.rb:86:in `convert'
from convert.rb:3
[dan ]$ pandoc --version
pandoc 1.11.1
...
[dan ]$ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
pandoc-ruby version: 0.7.4
我错过了一些明显的东西吗?