wicked_pdf: RuntimeError (Error: Failed to execute: "/usr/bin/wkhtmltopdf"
I am using wkhtmltopdf(0.10.0 rc2) and wicked_pdf(0.9.9) for generating pdf report. While running i got the following error.
RuntimeError (Error: Failed to execute:
["/usr/bin/wkhtmltopdf", "-q", "--page-size", "A4", "--margin-top", "5", "--margin-bottom", "10", "--margin-left", "5", "--margin-right", "5", "file:////tmp/[\"wicked_pdf\", \".html\"]21873-0", "/tmp/[\"wicked_pdf_generated_file\", \".pdf\"]21873-0"]
Error: PDF could not be generated!
Command Error: Error: Failed loading page file:////tmp/["wicked_pdf", ".html"]21873-0 (sometimes it will work just to ignore this error with --load-error-handling ignore)
)
my controller are:
render :pdf => "#{@note_name}",:layout => '/layouts/pdf_template.html.erb', :template=>'pdf/financial/maintenance_exp/maintenance_exp_pdf.html.erb'
Any help would be appreciated.
FYI:when I do :show_as_html=>true its not throwing any error.its rendering the html in browser.
About this issue
- Original URL
- State: open
- Created 10 years ago
- Comments: 31 (2 by maintainers)
@puneetpandey That branch has a binary specific to Amazon Linux, whereas the base branch and the released gem don’t (yet anyway).
The prior version of the gem must have just worked with Amazon Linux (0.12.4 was built differently from 0.12.5).
It’s fine to refer to that branch for now, but if that branch gets merged, it could get deleted. However the code would be in the main
wkhtmltopdf-binary
gem. It is a little safer to fork to your own repository and point to that, in case that happens.Alternately, you could simply pull the binary you need into your app at
bin/wkhtmltopdf
and pointexe_path
at that, but if you develop on a different platform, you’ll likely need more than one version.updating spring and running
bundle exec spring binstub --all
fixed my issue.