在heroku上实现邪恶的pdf的问题 [英] problem implementing wicked pdf on heroku
问题描述
我正在使用 本指南 在 heroku 上集成 wicked_pdf.但不知何故,它似乎不起作用.我从 heroku 得到了日志,它说:
I am using this guide for integrating wicked_pdf on heroku. But somehow it doesn't seem to work. I got the logs from heroku and its says this:
Processing PdfController#get_pdf to pdf (for 115.248.175.50 at 2011-02-15 23:54:44) [GET]
Parameters: {"format"=>"pdf", "action"=>"get_pdf", "id"=>"1", "controller"=>"pdf"}
***************WICKED***************
Rendering pdf/get_pdf
RuntimeError (PDF could not be generated!
/usr/ruby1.8.7/lib/ruby/1.8/open3.rb:73:in `exec': No such file or directory - /app/fa369291-829b-4b61-9efe-b2f0d0a0a42c/home/bin/wkhtmltopdf-amd64 - - (Errno::ENOENT)
from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:73:in `popen3'
from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:59:in `fork'
from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:59:in `popen3'
from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:57:in `fork'
from /usr/ruby1.8.7/lib/ruby/1.8/open3.rb:57:in `popen3'
from /app/fa369291-829b-4b61-9efe-b2f0d0a0a42c/home/vendor/plugins/wicked_pdf/lib/wicked_pdf.rb:22:in `pdf_from_string'
from /app/fa369291-829b-4b61-9efe-b2f0d0a0a42c/home/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:28:in `make_pdf'
from /app/fa369291-829b-4b61-9efe-b2f0d0a0a42c/home/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:39:in `make_and_send_pdf'
from /app/fa369291-829b-4b61-9efe-b2f0d0a0a42c/home/vendor/plugins/wicked_pdf/lib/pdf_helper.rb:13:in `render'
from /app/fa369291-829b-4b61-9efe-b2f0d0a0a42c/home/app/controllers/schedule_controller.rb:33:in `get_pdf'
请帮忙.提前致谢.
我对代码进行了一些更改并解决了此错误,但仍然卡在此处
I made some changes in my code and got through this error but still stuck here
NoMethodError(未定义的方法为空?对于#
推荐答案
在查看您的 Edit 部分后说未定义的方法为空?对于 #<Pathname:0x2b...>
After looking at your Edit part which says "undefined method empty? for #<Pathname:0x2b...>
这意味着你在某个地方使用空?路径对象上的函数而为空?是字符串的函数,而不是路径.
This means you are somewhere using empty? function on a path Object whereas empty? is a function of a string and not path.
尝试找出您在何处使用路径对象并在该对象上使用 to_s.
try to find out where you have used a path Object and use to_s on that object.
试试看.
这篇关于在heroku上实现邪恶的pdf的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!