2011-06-07 29 views
0

PDFKit不會與Ubuntu呈現在軌道上

束EXEC軌-v

的Rails 2.3.11

這wkhtmltopdf

在/ usr/bin中/ wkhtmltopdf

pdfkit(0.5.0)

該網站配有nginx + passenger

加載一個簡單的頁面生成:

 
/!\ FAILSAFE /!\ Tue Jun 07 00:55:33 -0400 2011 
    Status: 500 Internal Server Error 
    command failed: "/usr/bin/wkhtmltopdf" "--margin-right" "0.5in" "--page-size" "Letter" "--margin-top" "0.5in" "--margin-bottom" "0.5in" "--print-media-type" "--orientation" "Landscape" "--margin-left" "0.5in" "--quiet" "-" "-" 
    /usr/lib/ruby/gems/1.8/gems/pdfkit-0.5.0/lib/pdfkit/pdfkit.rb:71:in `to_pdf' 
    /usr/lib/ruby/gems/1.8/gems/pdfkit-0.5.0/lib/pdfkit/middleware.rb:19:in `call' 
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.11/lib/action_controller/string_coercion.rb:25:in `call' 
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/head.rb:9:in `call' 
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/methodoverride.rb:24:in `call' 
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.11/lib/action_controller/params_parser.rb:15:in `call' 
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.11/lib/action_controller/session/abstract_store.rb:177:in `call' 
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/query_cache.rb:29:in `call' 
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' 
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/query_cache.rb:9:in `cache' 
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/query_cache.rb:28:in `call' 
    /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call' 
    /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.11/lib/action_controller/failsafe.rb:26:in `call' 
    /usr/lib/ruby/gems/1.8/gems/rack-1.1.2/lib/rack/lock.rb:11:in `call' 

這與我的開發服務器完美的作品。任何疑難解答選項非常感謝

回答

1

我相信這個問題是你的路徑在PDFkit的初始化。 例如:

html_file = File.new('html/your-file.html') 
kit = PDFKit.new(html_file, :page_size => 'Letter', :header_html => "**html/template/header.html**", :footer_html => "**html/template/footer.html**") 

這是一個相對路徑,並且初始化,局部,是確定。也許你應該改變自己的路徑,以便與nginx正常工作。