4

It works fine on my development environment (osx), but I can't get it to work on the server.

in my gemfile

gem 'imgkit'
gem 'wkhtmltoimage-binary'

When I run:

kit = IMGKit.new(html, quality: 100)
img_binary = kit.to_img

I get this error

IMGKit::CommandFailedError: Command failed: 
/var/www/myapp/shared/bundle/ruby/2.3.0/bin/wkhtmltoimage --height 0 --quality 100 --format jpg - -: 
/var/www/myapp/shared/bundle/ruby/2.3.0/gems/wkhtmltoimage-binary-0.12.5/libexec/wkhtmltoimage-amd64: 
error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory

I've searched online and tried installing some more packages, but no success. Anyone able to help? Thanks.

Peter R
  • 3,185
  • 23
  • 43

1 Answers1

0

Using 'wkhtmltoimage-binary', '~> 0.11.0.1.1' in the Gemfile fixed the issue for me. Found the solution here.

Undo
  • 25,519
  • 37
  • 106
  • 129