views:

33

answers:

1

ruby -v = 1.9.1p378; rails -v = 2.3.8

wkhtmltopdf works just fine from the command line - generates a PDF. The path to the .exe is in the %PATH% variable as well as specified properly in the /config/initializers/wicked_pdf.rb file.

Set up the controller action to handler .pdf format but I get the following error

Permission denied - c:/Ruby191/bin/wkhtmltopdf - -

C:/Ruby191/lib/ruby/1.9.1/open3.rb:67:in 'spawn'  
C:/Ruby191/lib/ruby/1.9.1/open3.rb:67:in 'popen3'  
C:/work/hello/vendor/plugins/wicked_pdf/lib/wicked_pdf.rb:21:in 'pdf_from_string'  
C:/work/hello/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:28:in 'make_pdf'  
C:/work/hello/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:39:in 'make_and_send_pdf'  
C:/work/hello/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:13:in 'render_with_wicked_pdf'  
... controller related code follows ...

I've tried putting the wkhtmltopdf.exe (and related files) in various directories and checked permissions on those dirs to allow full control to Everyone.

Any help as to where the permission problem might be would be appreciated.

As a note: this works just fine run from the command line ruby pdftest.rb

require 'open3'
Open3.popen3('/bin/tools/wkhtmltopdf.exe http://www.google.com/ g.pdf')

The PDF is created with remarkable speed and no permission problems. Could be a problem with the account running WEBrick but I would think that would be solved by giving Everyone permission on the dir that has wkhtmltopdf.exe

A: 

I had to answer my own question. I'm stupid sometimes you know.

In the :exe_path variable I had put the path to the exe not including the name of the exe. when I added wkhtmltopdf.exe to the end of my existing path I fixed the permissions issue.

Posted in case someone else has the same issue.

Rob Sutherland