zakird / wkhtmltopdf_binary_gem

Ruby gem containing easily installable access to wkhtmltopdf application
https://rubygems.org/gems/wkhtmltopdf-binary
Apache License 2.0
183 stars 347 forks source link

Wicked gem fails using this gem on Ubuntu 22.04.02 LTS #160

Closed theempij closed 5 months ago

theempij commented 1 year ago

I use the wicked gem in a rails application. I have 2 computers. And is failing only on this one. Not sure if I used it before on this computer to generate PDFs. The error message names this gem. I dont have much tech knowledge so please provide instructions which are easy to exceute step by step :-)

The error message ->

Failed to execute: ["/home/julian/.rbenv/versions/2.6.6/bin/wkhtmltopdf", "--zoom", "1", "--orientation", "Portrait", "--dpi", "75", "--page-size", "A4", "--lowquality", "file:////tmp/wicked_pdf20230521-4835-6pp6w6.html", "/tmp/wicked_pdf_generated_file20230521-4835-fqwhes.pdf"] Error: PDF could not be generated! Command Error: /home/julian/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf:61:in <top (required)>': Invalid platform, must be running on Ubuntu 16.04/18.04/20.04 CentOS 6/7/8, Debian 9/10, archlinux amd64, or intel-based Cocoa macOS (missing binary: /home/julian/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/wkhtmltopdf-binary-0.12.6.5/bin/wkhtmltopdf_ubuntu_22.04_amd64). (RuntimeError) from /home/julian/.rbenv/versions/2.6.6/bin/wkhtmltopdf:23:inload' from /home/julian/.rbenv/versions/2.6.6/bin/wkhtmltopdf:23:in `

'

Output of 'lsb_release -a': No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy

taoxuau commented 1 year ago

Please run cat /etc/os-release to check what's your linux distro. It's using ID and VERSION_ID to determine which binary should be used.

theempij commented 1 year ago

My problem was solved by a friend. I think he ensured inside the Gemfile of the Rails app that the right version was loaded. But again. I have little tech knowledge. You might want to throw an exception which includes solution options.

pargara commented 6 months ago

@theempij Check this comment is probably going to help

https://github.com/zakird/wkhtmltopdf_binary_gem/issues/170#issuecomment-2081736741

unixmonkey commented 5 months ago

Ubuntu 22.04 support is now in version 0.12.6.7. Please check it and make sure it works for you, and reopen if it doesn't. Thanks!