我正在尝试在我的 rails 2.3 环境中的 Windows 中使用 pdfkit。然而,pdfkit 的中间件给出了一些错误,导致 rails 加载服务错误。我该怎么办?有没有易于使用的 PDFkit 替代品?
好吧,我目前正在关注 PDFKit 上的 Rails 截屏视频。我安装了 pdfkit gem,wkhtmltopdf,然后将中间件加载到 environment.rb 文件中,因为 require 'pdfkit' config.middleware.use "PDFKit::Middleware" 然后当我转到任何页面并添加 .pdf 扩展名时,我得到了500 服务器错误
/!\ FAILSAFE /!\ Sun Jul 11 18:42:53 +0530 2010 状态:500 内部服务器错误私有方法
chomp' called for nil:NilClass C:/Program Files/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in
method_missing' C:/Program Files/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/pdfkit -0.3.3/lib/pdfkit/pdfkit.rb:69:inwkhtmltopdf' C:/Program Files/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/pdfkit-0.3.3/lib/pdfkit/pdfkit.rb:33:in
初始化'C:/Program Files/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/pdfkit-0.3.3/lib/pdfkit/middleware .rb:25:innew' C:/Program Files/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/pdfkit-0.3.3/lib/pdfkit/middleware.rb:25:in
call' C:/Program Files/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:incall' C:/Program Files/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:in
call' C: /程序文件/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:incall' C:/Program Files/BitNami RubyStack/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in
call'