0

wicked_pdf と wkhtmltopdf を使用して HTML を PDF に変換していますが、localhost では正常に動作していますが、そのコードをサーバーにデプロイすると、サーバーで次のエラーが発生します。

エラーとログ

RuntimeError (Error: Failed to execute:
["/usr/local/bin/wkhtmltopdf", "-q", "--orientation", "Landscape", "--page-size", "Legal", "--margin-top", "27", "--margin-bottom", "40", "--margin-left", "20", "--margin-right", "20", "--header-spacing", "10", "--header-html", "file:////tmp/wicked_header_pdf20151126-3990-ttmmjg.html", "--footer-spacing", "5", "--footer-html", "file:////tmp/wicked_footer_pdf20151126-3990-6tmvq3.html", "file:////tmp/wicked_pdf20151126-3990-1r6mnm6.html", "/tmp/wicked_pdf_generated_file20151126-3990-10ir53b.pdf"]
Error: PDF could not be generated!
 Command Error: /usr/local/bin/wkhtmltopdf: 1: /usr/local/bin/wkhtmltopdf:~: not found
/usr/local/bin/wkhtmltopdf: 1: /usr/local/bin/wkhtmltopdf: cannot create ... Directory nonexistent
/usr/local/bin/wkhtmltopdf: 1: /usr/local/bin/wkhtmltopdf:ELF: not found
/usr/local/bin/wkhtmltopdf: 3: /usr/local/bin/wkhtmltopdf: Syntax error: word unexpected (expecting ")")
):

usr/local/bin/wkhtmltopdf は実稼働サーバーに存在しますが、それでも上記のエラーが発生します。

4

1 に答える 1

1

プロダクションへのアクセスはありますか?

持っている場合は、アプリケーションと同じユーザーでログインし、これを実行します。

ls -t /usr/local/bin/wkhtmltopdf

良い結果が得られない場合は、アプリケーションが間違ったパスを指していることを意味します。

乾杯

于 2015-11-30T18:40:31.887 に答える