wkhtmltopdf RuntimeError(wkhtmltopdf的位置未知) [英] wkhtmltopdf RuntimeError (Location of wkhtmltopdf unknown)

查看:446
本文介绍了wkhtmltopdf RuntimeError(wkhtmltopdf的位置未知)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Ubuntu 11.04在Ruby on Rails中开发应用程序。
在应用程序中,我需要生成pdf文档。所以我使用
的wicked_pdf和wkhtmltopdf二进制gems。



在我的系统的开发环境一切都很好。
但是一旦我在CentOS 5.6上使用Phusion
Passenger部署了应用程序,当我试图生成pdf的时候,它给我以下错误:



RuntimeError(wkhtmltopdf位置未知)



我使用Ruby1.9.2.p136
Rails 3.1.1



任何帮助将非常感谢....感谢。

解决方案

你使用静态wkhtmltopdf二进制吗?我下载了此处,并将其解析为 / path / to / rails_app / bin



并将其添加到栏目中:

 #config / initializers / wicked_pdf.rb 
WickedPdf.config = {
:exe_path => Rails.root.join('bin','wkhtmltopdf-i386')。to_s,
}


I am using Ubuntu 11.04 to develop an app in Ruby on Rails. In the app I need to generate pdf documents. So I am using the wicked_pdf and wkhtmltopdf-binary gems.

In the development environment in my system everything is working fine. But once I deployed the app in production on CentOS 5.6 using Phusion Passenger, when I try to generate pdfs on the fly its giving me the following error:

RuntimeError (Location of wkhtmltopdf unknown)

I am using Ruby1.9.2.p136 Rails 3.1.1

Any help will be much appreciated....Thanks.

解决方案

do you use static wkhtmltopdf binary? i downloaded it here and extraced it to /path/to/rails_app/bin

and add it to rails like this:

#config/initializers/wicked_pdf.rb
WickedPdf.config = {
  :exe_path => Rails.root.join('bin', 'wkhtmltopdf-i386').to_s,
}

这篇关于wkhtmltopdf RuntimeError(wkhtmltopdf的位置未知)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆