Hey anyone,
I'm using htmldoc-0.2.3 on ruby 1.8.7 and I'm struggling to get it
working. I've created the following ruby file and get the following
error:
------
require 'rubygems'
require 'htmldoc'
pdf = PDF::HTMLDoc.new
pdf.set_option :outfile, "/tmp/outfile.pdf"
pdf << 'test text'
if pdf.generate
puts "Successfully generated a PDF file"
else
puts pdf.result[:output]
end
----
Error:
/Users/dandan/.rvm/gems/ruby-1.8.7-p302/gems/htmldoc-0.2.3/lib/
htmldoc.rb:182:in `execute': Invalid program path: htmldoc
(PDF::HTMLDocException)
from /Users/dandan/.rvm/gems/ruby-1.8.7-p302/gems/htmldoc-0.2.3/lib/
htmldoc.rb:154:in `generate'
from pdf.rb:17
To attempt to fix this I added
PDF::HTMLDoc.program_path = '/Users/dandan/.rvm/gems/ruby-1.8.7-p302/
gems/htmldoc-0.2.3'
Running the script again I get the output from pdf.result[:output]:
sh: /Users/dandan/.rvm/gems/ruby-1.8.7-p302/gems/htmldoc-0.2.3: is a
directory
Has anyone else experienced this problem and has a solution. I'm
guessing I'm giving the wrong program path but I'm not sure which path
I should be giving.
Thanks abundantly for any help!
Dan
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment