Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New binary is a need to install the dependent libraries #19

Closed
rewish opened this issue Sep 13, 2014 · 12 comments
Closed

New binary is a need to install the dependent libraries #19

rewish opened this issue Sep 13, 2014 · 12 comments

Comments

@rewish
Copy link

rewish commented Sep 13, 2014

Ubuntu 14.04 64-bit

sudo apt-get install libjpeg62 libfontconfig-dev

Ubuntu 14.04 32-bit

sudo apt-get install libjpeg-dev libfontconfig-dev

CentOS 7.0

sudo yum install libjpeg libpng12 libXrender libXext fontconfig

CentOS 6.3 64-bit

sudo yum install libjpeg libpng libXrender libXext fontconfig

CentOS 6.3 32-bit

wkhtmltopdf_linux_x86 -V
#=> wkhtmltopdf_linux_x86: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory

sudo yum install libjpeg.so.8
#=> No package libjpeg.so.8 available.

Dependent libraries for 32-bit does not exist in the standard RPM repositories of CentOS.

I've tried creating a symlink, but it doesn't work:

ln -s /usr/lib/libjpeg.so.62 /usr/lib/libjpeg.so.8

wkhtmltopdf_linux_x86 -V
#=> /path/to/wkhtmltopdf_linux_x86: /usr/lib/libjpeg.so.8: version `LIBJPEG_8.0' not found (required by /path/to/wkhtmltopdf_linux_x86)
#=> /path/to/wkhtmltopdf_linux_x86: /lib/libc.so.6: version `GLIBC_2.15' not found (required by /path/to/wkhtmltopdf_linux_x86)

Do you have a solution?

@zakird
Copy link
Owner

zakird commented Sep 15, 2014

Has anyone compiled it this with statically linked dependencies? What's the size of the executable? This would avoid the OS nonsense.

@rewish
Copy link
Author

rewish commented Sep 15, 2014

@tbugai How did you build?

@tbugai
Copy link
Contributor

tbugai commented Sep 15, 2014

The latest binaries were downloaded from the wkhtmltopdf project page.

Keep in mind, the more libraries that get statically built into the binary the larger the binary is going to be. They already weigh in at about 40MB each. Systems like heroku limit the deployed project size so this becomes an issue as all three binaries are included in the gem.

@rewish
Copy link
Author

rewish commented Sep 16, 2014

Hmmm.

Since it does not support 32-bit from the CentOS 7 or later, the 32-bit CentOS 6 may not be a big problem...

@richardarosenthal
Copy link

Was a workaround for this ever figured out on Centos 32 bit?

@anazar
Copy link

anazar commented Dec 16, 2014

this is also an issue on the new heroku cedar-14 stack

@richardarosenthal
Copy link

I solved this by grabbing the v8 file out of another distro's repository (found through a simple google search for the file itself) and manually scp'ing it into the usr/library folder. As long as you don't change any existing symlinks (v6 or whatever it is) you shouldn't disrupt anything else.

@oboxodo
Copy link

oboxodo commented Dec 22, 2014

Hi there.

Could you please post here (or in a README file) what exact commands are you using to compile these binaries? That way it would be easier for us to send pull-requests with updated files for you to consider.

In my particular case, I'm deploying a project with this gem in Heroku and upgrading from cedar stack to cedar-14 is not possible because libjpeg62 is not there anymore. @anazar mentioned this issue too.

My approach to workaround this would be to compile a new binary called wkhtmltopdf_linux_amd64_jpeg8 and use that one if libjpeg8 is detected.

@unixmonkey
Copy link
Collaborator

As mentioned above, right now the binaries are the compiled binaries from http://wkhtmltopdf.org

If you can compile them to include the necessary stuff and send a pull request, I'd be glad to merge it in.

@maikelvl
Copy link

maikelvl commented May 2, 2015

Running apt-get install libjpeg-dev on Ubuntu 14.04 64-bit worked in my case

@unixmonkey
Copy link
Collaborator

Closing this now that we have sorted out the process of incorporating official wkhtmltopdf releases into this project.

Thanks everyone for your tips and suggestions!

@equivalent
Copy link

noticing somethnig simmilar in ubuntu 18.04

    IMGKit::CommandFailedError:
       Command failed: /home/t/.rvm/gems/ruby-2.7.1@projectname/bin/wkhtmltoimage --height 0 --quality 50 --width 600 --format jpg - -: /home/t/.rvm/gems/ruby-2.7.1@projectname/gems/wkhtmltoimage-binary-0.12.5/libexec/wkhtmltoimage-amd64: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

using

 wkhtmltoimage-binary (0.12.5)
imgkit (1.6.2)
ruby-2.7.1
rails 6.0.3.2

rvm 1.29

I've tried apt-get install libjpeg-dev and didn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants