Ale*_*lex 5 heroku wkhtmltopdf ruby-on-rails-3
按照https://github.com/jordan-brough/heroku-pdf上的指南,我设法让wicked_pdf在本地工作并按预期创建PDF.然而,一旦我推送到heroku,应用程序崩溃一段时间我每次调用pdf
日志给了我这个:
2011-05-19T06:36:56+00:00 app[web.1]: Started GET "/authors/cash_payment_receipt/4dd4aff0a2d5a5000100000c.pdf" for XXX.XXX.XXX.XXX at Wed May 18 23:36:56 -0700 2011
2011-05-19T06:36:56+00:00 heroku[router]: Error H13 (Connection closed without response) -> GET xxx.xxxx.com/authors/cash_payment_receipt/4dd4aff0a2d5a5000100000c.pdf dyno=web.1 queue=0 wait=0ms service=0ms bytes=0
2011-05-19T06:36:56+00:00 app[web.1]: !! Unexpected error while processing request: PDF could not be generated!
2011-05-19T06:36:56+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/wkhtmltopdf-0.1.2/bin/wkhtmltopdf_linux_386: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我将wkhtmltopdf bin添加到我的rails-root/bin目录,检查权限,一切正常.我首先尝试了0.10rc2并向下移动到0.9.9,但它都给出了相同的结果.
我在谷歌上找不到与我的错误相关的任何内容.我不明白我做错了什么.
环境是: - rails 3.0.7 - ruby 1.8.7
谢谢,
麦酒
我最近为wkhtmltopdf二进制文件创建了一个GEM,可以在heroku上工作,而无需在自己的存储库中安装任何二进制文件.它还包含用于开发的OSX(darwin)二进制文件.它适用于PDFKit,也可能与WickedPDF一起使用
https://github.com/bradphelan/wkhtmltopdf-heroku
Run Code Online (Sandbox Code Playgroud)
或者在你的Gemfile中
gem "wkhtmltopdf-heroku"
Run Code Online (Sandbox Code Playgroud)