pdf无法呈现pdf 500错误

我无法让wicked_pdf在Mac OSX 10.8.2,Ruby 1.9.2,Rails 3.2.11的本地工作

如果任何人有任何智慧分享这个问题,请做。

在我的Gemfile中我有:

gem "wicked_pdf"

group :development do
  gem "wkhtmltopdf"
  gem "wkhtmltopdf-binary"
  ...
end

group :production do
  gem "wkhtmltopdf-heroku"
end

我的控制器中有以下内容:

def show
  ...
  respond_to do |format|
  format.html
  format.pdf do
    render :pdf => 'filename',
           :handlers => [:haml]
    end
  end
end

在我看来,我有这个链接:

= link_to 'Create PDF document', consultant_path(@consultant, :format => :pdf)

点击时得到相同的URL并在其末尾添加.pdf。

这是从日志中获得输出的内容。

Started GET "/profiler/user1.pdf" for 127.0.0.1 at 2013-02-19 10:23:12 +0100
Processing by ConsultantsController#show as PDF
  Parameters: {"id"=>"user1"}
  Consultant Load (0.3ms)  SELECT "consultants".* FROM "consultants" WHERE"consultants"."slug" = 'user1' LIMIT 1

User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
CACHE (0.0ms)  SELECT "consultants".* FROM "consultants" WHERE "consultants"."slug" = 'user1' LIMIT 1
***************WICKED***************
Rendered consultants/show.pdf.haml (34.3ms)
Rendered text template (0.0ms)
Completed 500 Internal Server Error in 57ms (Views: 3.2ms | ActiveRecord: 0.5ms)

看起来邪恶在工作,但渲染失败了?

链接地址: http://www.djcxy.com/p/63949.html

上一篇: pdf can't render pdf 500 error

下一篇: pdf, wkhtmltopdf not working with SVG on Heroku