pdfkit command fail error #156

maurodias opened this Issue Nov 29, 2012 · 8 comments


None yet
5 participants

Followed the wiki instructions for pdfkit and this was my output: command failed: "/usr/bin/wkhtmltopdf" "--encoding" "UTF-8" "--page-size" "A4" "--margin-top" "0.25in" "--margin-right" "1in" "--margin-bottom" "0.25in" "--margin-left" "1in" "--quiet" "-" "-"

May anyone help me? I don't have any idea bout what can be occurring.

I've checked my wkhtmltopdf version, that is 0.9.9. In my Gemfile I've just put gem 'pdfkit', and also done in bash: gem install wkhtmltopdf-binary

Many guess it could be the version of wkhtmltopdf and arg quiet/quit that differs and some versions,
Take at look at this checks:

$ /usr/bin/wkhtmltopdf www.google.com go --quiet
$ /usr/bin/wkhtmltopdf www.google.com go --quit
Unknown long argument --quit
 wkhtmltopdf 0.9.9

What shows my version should keep the --quiet arg by default

Thanks in advance

sodabrew commented Dec 1, 2012

Why do you have two single dashes at the end?

I think the unknown argument is --quiet not quit.

It changes due to the version you are using, I guess before 0.9 it was --quit and after --quiet (not sure)

I've already changed this line, for quiet, neither one nor other works, the solution was use Wicked_pdf, anyway if there is a solution I would want to know.

vpereira commented Jan 8, 2013

just as information, i'm getting the same error here

command failed: "/home/foo/.rvm/gems/ruby-1.9.3-p286/bin/wkhtmltopdf" "--page-size" "Letter" "--margin-top" "0.75in" "--margin-right" "0.75in" "--margin-bottom" "0.75in" "--margin-left" "0.75in" "--encoding" "UTF-8" "--print-media-type" "--quiet" "-" "-"

foo@deathstar:~/eacus_server$ which wkhtmltopdf

wkhtmltopdf 0.9.6

pdfkit (0.5.2)

vpereira commented Jan 8, 2013

i found the problem. we have to add to the Gemfile the wkhtmltopdf-bin gem as:

|gem 'wkhtmltopdf-binary'

after that I was able to use it. I didn't check the README to see if is there..

vpereira commented Jan 8, 2013

p.s: i had before the gem installed by hand, symlinked to /usr/local/bin, I could call it via CLI without problem. So i think it should be in the README.

vpereira commented Jan 8, 2013

just one thing. The middleware isn't able to find the binary, but via console (or background tasks) it works.

vpereira commented Jan 8, 2013

with unicorn everything works fine.

devn closed this May 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment