Help us understand the problem. What is going on with this article?

wicket_pdf導入時にAWS EC2でwkhtmltopdfがエラーになったときの対応

More than 3 years have passed since last update.

wkhtmltopdf-binary-edgeを使うようにという情報がよくあるのですが、これは同梱されてるバイナリがUbuntu,OSX用なのでEC2にデプロイするとエラーになる。

wkhtmltopdf-binary-amlがAmazonLinux対応版なので、コイツを使うとEC2上でも動作しました。
https://github.com/insphire/wkhtmltopdf-binary-aml

# Gemfile
# ダメな奴
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary-edge'
# こういうエラーが出る
An exception occurred: 'Error: Failed to execute:
["/home/appuser/hoge/shared/bundle/ruby/2.1.0/bin/wkhtmltopdf", "-q", "--encoding", "UTF-8", "--javascript-delay", "5000", "--margin-top", "0", "--margin-bottom", "0", "--margin-left", "0", "--margin-right", "0", "file:////tmp/wicked_pdf20151118-29615-r2ey25.html", "/tmp/wicked_pdf_generated_file20151118-29615-14wgdtb.pdf"]
Error: PDF could not be generated!
Command Error: /home/appuser/hoge/shared/bundle/ruby/2.1.0/gems/wkhtmltopdf-binary-edge-0.12.2.1/libexec/wkhtmltopdf-linux-amd64: error while loading shared libraries: libjpeg.so.8: cannot open shared object file: No such file or directory
' on '/home/appuser/hoge/shared/bundle/ruby/2.1.0/bundler/gems/wicked_pdf-69350a2735e8/lib/wicked_pdf.rb:62:in `rescue in pdf_from_string''
# Gemfile
# EC2対応
gem 'wicket_pdf'
gem 'wkhtmltopdf-binary-aml', git: 'https://github.com/insphire/wkhtmltopdf-binary-aml'
【2016/07/14現在】
wkhtmltopdf-binary-0.12.3がリリースされており、当問題は解消されているようです。
但し、日本語が正しく表示されない問題は継続して存在するため、環境に応じたフォントの導入作業は
必要です。

参考:
http://qiita.com/s-mori/items/00aef46e6a10499f8254

yaboojp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした