application.rb
require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'pdfkit'
Bundler.require(:default, Rails.env)
module PdfTest
class Application < Rails::Application
config.middleware.use PDFKit::Middleware, :print_media_type => true
end
end
config/initializers/pdfkit.rb
PDFKit.configure do |config|
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
end
controller
respond_to :html, :pdf
然后写了一个 test.html.erb 页面
后缀加上".pdf" 报如下错误
请指教一二,谢谢