zakird / wkhtmltopdf_binary_gem

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

Missing libpng12 in Amazon Linux2 #83

Closed rintaro-ishikawa closed 4 years ago

rintaro-ishikawa commented 4 years ago

Error on Amazon Linux 2. error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

I resolved like this.

This is current code. wkhtmltopdf_binary_gem/bin/wkhtmltopdf

           # CentOS 6 doesn't have `/etc/os-release`.
           if (os.empty? && File.read('/etc/centos-release').start_with?('CentOS release 6')) ||
               os.start_with?('amzn_')
             os = 'centos_6'
           end

I changed the code like this.

           if os.start_with?('amzn_2')
             os = 'centos_7'
           end

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