【发布时间】:2015-03-22 17:11:06
【问题描述】:
我的应用程序在本地运行良好,但是当推送到 heroku 时,它会因特定操作而崩溃:打开 PDF 文档。我正在使用 PDFKit 进行使用 wkhtmltopdf 中间件的文档渲染。这是我的错误信息:
2015-03-20T23:35:11.306857+00:00 app[web.1]: Processing by PcsController#show as HTML
2015-03-20T23:35:11.605847+00:00 app[web.1]: Rendered pcs/show.html.erb within layouts/application (27.5ms)
2015-03-20T23:35:11.614100+00:00 app[web.1]: Completed 200 OK in 307ms (Views: 45.8ms | ActiveRecord: 27.1ms)
2015-03-20T23:35:13.127259+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=myhost.herokuapp.com request_id=671d7282-5765-475e-bdf1-411e8d66efe3 fwd="71.45.94.25" dyno=web.1 connect=1ms service=8ms status=304 bytes=111
2015-03-20T23:35:12.997916+00:00 app[web.1]: RuntimeError (command failed (exitstatus=0): /app/vendor/bundle/ruby/2.1.0/bin/wkhtmltopdf --page-size Letter --margin-top 0.75in --margin-right 0.75in --margin-bottom 0.75in --margin-left 0.75in --encoding UTF-8 --print-media-type - -):
显然,wkhthmltopdf 存在一些问题,但我似乎无法通过文档或互联网找到解决方案。这些是默认设置——我曾经使用元标记更改它们,但后来决定恢复为默认设置(布局决定,而不是功能决定)。我使用 Unicorn 作为我的 Web 服务器并分配了 3 个工作进程。希望有人有一些想法。
【问题讨论】:
-
你试过在heroku上运行
bundle install吗? -
检查并且我的包是最新的
标签: ruby-on-rails heroku wkhtmltopdf pdfkit