当我运行这样的命令时,它会生成 pdf 文档:
$ wkhtmltopdf http://google.com google.pdf
Loading pages (1/5)
Resolving links (2/5)
Counting pages (3/5)
Printing pages (5/5)
Done
但是当通过 pdfkit gem 使用内部应用程序时,它显示错误
merb : worker (port 4000) ~ command failed: "/usr/local/bin/wkhtmltopdf" "--page-size" "Letter" "--print-media-type" "--margin-right" "0.0in" "--encoding" "UTF-8" "--margin-top" "0.5in" "--margin-bottom" "0.5in" "--margin-left" "0.0in" "--quiet" "-" "-" - (RuntimeError)
尝试了什么:
设置路径
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf '
安装依赖项
sudo aptitude install openssl build-essential xorg libssl-dev
环境
- Ubuntu 12.04 amd64
- 合并申请
- 红宝石 1.8.7