2012-02-06 59 views
2

我正在嘗試使用wicked_pdf生成PDF生成報告。 PDF生成工作正常在我的開發環境,但它失敗,一旦它的部署在Herokuwicked_pdf未能在heroku上部署PDF生成報告

這是我收到的錯誤:

Failed to execute: 
/app/.bundle/gems/ruby/1.9.1/bin/wkhtmltopdf --header-font-name 'Century Gothic' --header-left 'My Test - Neuffen, Germany' --header-right '2012-02-05 15:50:57 -0800' --header-font-size 14 --header-line --footer-center 'Generated by Biowatts - http://biowatts.org' --footer-font-name 'Century Gothic' --footer-font-size 13 --footer-line --toc-font-name 'Century Gothic' --toc-disable-links --toc-disable-back-links  --orientation 'Landscape' --no-background -q - - 
Error: PDF could not be generated! 
.bundle/gems/ruby/1.9.1/gems/wicked_pdf-0.7.2/lib/wicked_pdf.rb:39:in `rescue in pdf_from_string' 

不知道如何解決這個問題?

20120207 - 其他attemps

通過添加這些對我的寶石文件,我得到一個diffenret錯誤:

group :production do 
    gem "wkhtmltopdf-heroku", :git => 'git://github.com/camdez/wkhtmltopdf-heroku.git' 
end 

的錯誤:

Location of wkhtmltopdf unknown 
    .bundle/gems/ruby/1.9.1/gems/wicked_pdf-0.7.2/lib/wicked_pdf.rb:20:in `initialize' 
+0

好吧我試圖改進說明文字。我仍然不明白過熱的-1?另外,如果我的問題重新開放,我會很感激。 – zabumba 2012-02-06 22:48:26

+0

我投票重新開放。我不太明白爲什麼它關閉。你找到解決方案嗎? – nathanvda 2012-03-07 21:07:38

+0

只能解決並使用另一個寶石。 gem「pdfkit」,「〜> 0.5.2」,但最終導致與Rails 3.1資產的兼容性問題。它顯然固定在3.2。這個視頻幫助了很多http://railscasts.com/episodes/220-pdfkit,你需要將wkhtmltopdf二進制文件添加到你的項目/應用程序/ bin – zabumba 2012-03-08 22:12:54

回答

2

您是否使用正確的wkhtmltopdf庫? 類似這樣的一個:

group :production do 
    gem "wkhtmltopdf-heroku", :git => 'git://github.com/camdez/wkhtmltopdf-heroku.git' 
end 
+1

這不起作用,現在我得到了一個不同的錯誤。請參閱我的oringal帖子中的修改 – zabumba 2012-02-07 17:25:03