我们的平台已经上线了一段时间并且运行良好。我们的客户可以很好地下载 PDF 格式的发票。
我们已经进行了几个月的升级,就在今天,我们注意到使用 wicked_pdf 和 wkhtmltopdf 生成的“突然”非 PDF 不再工作......
我完全不知道为什么,我检查了我能想到的一切: - 路由 - 初始化程序 - 宝石 - 等等。
一切似乎都很好,与实际唯一的版本相同。
我们没有更改 Rails 或 Ruby 版本。一切都差不多: - Ruby 1.8.7 REE - Rails 3.0.10
我们得到的错误是:
Rendered groups/clients/proforma.pdf.haml (103.4ms)
Sent data toto.pdf (2.7ms)
Completed 500 Internal Server Error in 6892ms
NoMethodError (undefined method `virtual_path' for text template:ActionView::Template::Text):
app/controllers/groups/clients_controller.rb:980:in `proforma'
app/controllers/groups/clients_controller.rb:976:in `proforma'
lib/include/flash_session_cookie_middleware.rb:16:in `call'
lib/include/flash_session_cookie_middleware.rb:16:in `call'
控制器看起来像:
def proforma
@request = WireRequest.where(:_id => params[:id], :status => :pending).first
respond_to do |format|
format.html {render :layout => false}
format.pdf do
unless @request.nil?"
render(:pdf => "PROFORMA_#{@request.invoice_num}", :layout => 'pdf')
end
end
end
end
有什么想法可能会出错吗?我没有更多的想法:(