diff --git a/README.md b/README.md index 89907e2..4089519 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ +FORK NOTES + +This is a forked version of this gem to play nice with CentOS 6.7 64 bit. + +A pull request that may or may not be generally useful has been sent to the owning repo. + +I was getting the following error running the IMGKit gem on Centos: + +libjpeg.so.8: cannot open shared object file + +For this modified branch, it contains the wkhtmltoimage binary specifically for Centos 6 64bit, +compiled on Centos 6.6, extracted from the rpm package at http://wkhtmltopdf.org/downloads.html. + +Also was hitting error with the lsb_version check so added a thrown error if that command fails so at least it would be easier for someone to fix the issue (ie adding the package containing that command). + + +ORIGINAL README + Provides linux and Mac binaries for wkhtmltoimage. Uses the current Version of wkhtmltoimage (LGPL) diff --git a/bin/wkhtmltoimage b/bin/wkhtmltoimage index 2eaddf2..f8669ae 100755 --- a/bin/wkhtmltoimage +++ b/bin/wkhtmltoimage @@ -1,13 +1,26 @@ #!/usr/bin/env ruby +require 'mkmf' + arch = case RUBY_PLATFORM when /64.*linux/ - case `lsb_release -c` - when /jessie/ # Debian 8 - Jessie - 'jessie-amd64' + lsb_release_exe = find_executable('lsb_release') + if lsb_release_exe + case `lsb_release -c` + when /jessie/ # Debian 8 - Jessie + 'jessie-amd64' + else + # alternative binary for CentOS 6.7 + release = `cat /etc/*release` + if release.match(/CentOS release 6\.7/) + 'centos67-amd64' + else + 'amd64' + end + end else - 'amd64' - end + raise '`lsb_release` command not found on host OS. Please install.' + end when /linux/ 'i386' when /darwin/ diff --git a/lib/wkhtmltoimage-binary/version.rb b/lib/wkhtmltoimage-binary/version.rb index 3d985d6..0bb357f 100644 --- a/lib/wkhtmltoimage-binary/version.rb +++ b/lib/wkhtmltoimage-binary/version.rb @@ -1,5 +1,5 @@ module Wkhtmltoimage module Binary - VERSION = "0.12.2" + VERSION = "0.12.3" end end diff --git a/libexec/wkhtmltoimage-centos67-amd64 b/libexec/wkhtmltoimage-centos67-amd64 new file mode 100755 index 0000000..b2501ae Binary files /dev/null and b/libexec/wkhtmltoimage-centos67-amd64 differ