WKHTMLTOPDF path in ROR application

In the source of wkhtmltopdf it looks like all it is doing is running File.exists? on that path:

https://github.com/mileszs/wicked_pdf/blob/56aa1a195d65eaaf33fbd0254e1e7df99ce1fd1c/lib/wicked_pdf.rb#L41

So we gotta double check the assumption that wkhtmltopdf is correctly installed at /usr/local/bin/wkhtmltopdf

Could you give a bit more information? Just to verify, what is the output of which wkhtmltopdf

And when you run wkhtmltopdf -V in the console, what do you get?

You could try specifying the path in the configuration (in an initializer as mentioned in the wkhtmltopdf readme) just to see if that makes a difference too.

And lastly you could move the executable to a different directory, and then specify that in the initializer to see if it maybe has something to do with folder permissions.


Have you tried specifying the path in an initializer? ({rails.root}/config/initializers/wicked_pdf.rb) ex..

WICKED_PDF = {
    :exe_path => '/usr/local/bin/wkhtmltopdf-amd64'#should be whatever your version is called
}

wkhtmltopdf will install into /usr/bin/wkhtmltopdf but it's expected at /usr/local/bin/wkhtmltopdf.

To fix it just create symbolic link as (probably you will need to use sudo):

ln -s /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf