Question

I have just installed pandoc using gem install pandoc-ruby and have tried running this sample script:

require 'pandoc-ruby'
@converter = PandocRuby.new('# Markdown Title', :from => :markdown, :to => :rst)
puts @converter.convert

I get the following errors:

open3.rb:202: in spawn': No such file or directory - pandoc --from=markdown --to=rst (Errno::ENOENT)
open3.rb:202: inpopen_run'
open3.rb:90: in popen3'
pandoc-ruby.rb:101: inexecute'
pandoc-ruby.rb:77: in convert'
pandoc test.rb:3: in'

I assume that as the script is one of the ones given as an example on the pandoc-ruby github that there must be something wrong with the installation. Does anyone know how to fix this?

Many thanks

Was it helpful?

Solution

The error looks like Ruby is unable to find the pandoc executable.

To tell Pandoc where to find the executable, use the bin_path method:

PandocRuby.bin_path='/usr/local/bin'

Set bin_path to the directory where you put the pandoc executable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top