I'm having some trouble while trying to generate an pdf through the pdf_from_url
method on production.
The error is the following:
Error: PDF could not be generated!
Command Error: /app/vendor/bundle/ruby/2.5.0/gems/wkhtmltopdf-binary-edge-0.12.5.0/libexec/wkhtmltopdf-linux-amd64: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
The line bellow throws the error above:
pdf = WickedPdf.new.pdf_from_url("https://google.com", {:temp_path => Rails.root.join('public')})
The error only occurs on production. Everything works normaly on development.
Running wkhtmltopdf https://google.com test.pdf
via command line on the server works normally.
One thing to notice is that my application server runs on a dokku container, which i'm inexperienced in. So, probably the error occurs due to the way of how dokku's file architeture works.
What i have already tried:
- Changed wkhtmltopdf's gem from
wkhtmltopdf-binary
towkhtmltopdf-binary-edge
- Installed libpng12 manualy on the server (not on dokku container)
What i'm using currently:
wicked_pdf gem version: 1.1.0
whtmltopdf [provider gem]: wkhtmltopdf-binary-edge ~> 0.12.5
platform/distribution and version: Dokku container running on Ubuntu 18.04