【问题标题】:Issue getting wkhtmltoimage working on Amazon Linux / Ruby on Rails让 wkhtmltoimage 在 Amazon Linux / Ruby on Rails 上工作的问题
【发布时间】:2019-03-14 10:18:40
【问题描述】:

它在我的开发环境 (osx) 上运行良好,但我无法让它在服务器上运行。

在我的 gemfile 中

gem 'imgkit'
gem 'wkhtmltoimage-binary'

当我跑步时:

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

我收到此错误

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

我在网上搜索并尝试安装更多软件包,但没有成功。有谁能帮忙吗?谢谢。

【问题讨论】:

  • 你有没有找到解决这个问题的办法?在 CircleCI 实例上运行时,我看到了完全相同的行为。

标签: amazon-ec2 centos yum amazon-linux


【解决方案1】:

在 Gemfile 中使用 'wkhtmltoimage-binary', '~> 0.11.0.1.1' 为我解决了这个问题。找到解决方案here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-10
    • 1970-01-01
    • 2020-06-13
    • 2013-12-03
    相关资源
    最近更新 更多