错误如下:
RuntimeError in ProductsController#show
command failed: "/home/que/.rvm/gems/ruby-1.9.3-p125/bin/wkhtmltopdf" "--page-size" "Letter" "--margin-top" "0.75in" "--margin-right" "0.75in" "--margin-bottom" "0.75in" "--margin-left" "0.75in" "--encoding" "UTF-8" "--print-media-type" "--quiet" "-" "-"
我的 gem:
gem 'pdfkit'
gem 'wkhtmltopdf-binary'
config/application.rb
require 'pdfkit'
config.middleware.use PDFKit::Middleware, :print_media_type => true
config/initializers/pdfkit.rb
PDFKit.configure do |config|
config.wkhtmltopdf = '/home/que/.rvm/gems/ruby-1.9.3-p125/bin/wkhtmltopdf'
# config.default_options = {
# :page_size => 'Legal',
# :print_media_type => true
# }
# config.root_url = "http://localhost" # Use only if your external hostname is unavailable on the server.
end
终端查看 wkhtmltopdf:
$ which wkhtmltopdf
/home/que/.rvm/gems/ruby-1.9.3-p125/bin/wkhtmltopdf
wkhtmltopdf 版本:
$ wkhtmltopdf --version
Name:
wkhtmltopdf 0.9.6
License:
Copyright (C) 2008,2009 Wkhtmltopdf Authors.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.
Authors:
Written by Jakob Truelsen. Patches by Mário Silva, Benoit Garret and Emmanuel
Bouthenot.
请问大家有没有出现过这样的问题呢?最后如何解决的呢?我网上找了好多的方法都是弄不好,也搞不懂是什么回事。