zakird / wkhtmltopdf_binary_gem

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

Missing libpng12 in AmazonLinux2023 #161

Open strviola opened 1 year ago

strviola commented 1 year ago

An error occured on AmazonLinux2023:

RuntimeError PDF could not be generated!
 Command Error: /var/www/app/shared/bundle/ruby/3.0.0/gems/wkhtmltopdf-binary-0.12.6.6/bin/wkhtmltopdf_centos_6_amd64: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

This is my cat /etc/os-release :

NAME="Amazon Linux"
VERSION="2023"
ID="amzn"
ID_LIKE="fedora"
VERSION_ID="2023"
PLATFORM_ID="platform:al2023"
PRETTY_NAME="Amazon Linux 2023"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2023"
HOME_URL="https://aws.amazon.com/linux/"
BUG_REPORT_URL="https://github.com/amazonlinux/amazon-linux-2023"
SUPPORT_END="2028-03-01"

I think bin/wkhtmltopdf should concern os is amzn_2023 at here:

           os = 'centos_6' if (os.start_with?('amzn_') && os != 'amzn_2') ||
                              (os.empty? && File.read('/etc/centos-release').start_with?('CentOS release 6'))

           os = 'centos_7' if (os.start_with?('amzn_2') && !os.start_with?('amzn_20')) ||
                              os.start_with?('rhel_7.')
RescuePenguin commented 9 months ago

Can confirm this issue. I've tried hacking around it to make it use the centos 7 & 8 binaries, but the issue goes further than just the libpng version being used. Also ran into issues with libssl and libcrypto, which are both looking for versions 1.1 and the system has version 3.0.8 installed.

wimpog commented 2 months ago

I see this issue is marked as "completed on Apr 3". I'm still facing this issue. Any updates on it?