pdf can't render pdf 500 error
I can't get wicked_pdf to work locally on Mac OSX 10.8.2, Ruby 1.9.2, Rails 3.2.11
If anyone has any wisdom to share on the matter, please do.
In my Gemfile I have:
gem "wicked_pdf"
group :development do
gem "wkhtmltopdf"
gem "wkhtmltopdf-binary"
...
end
group :production do
gem "wkhtmltopdf-heroku"
end
I have the following in my Controller:
def show
...
respond_to do |format|
format.html
format.pdf do
render :pdf => 'filename',
:handlers => [:haml]
end
end
end
In my view I have this link:
= link_to 'Create PDF document', consultant_path(@consultant, :format => :pdf)
Which when clicked gets the same URL and adds .pdf to the end of it.
This is what gets output from the log.
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)
It seems that wicked is working somewhat but the render fails?
链接地址: http://www.djcxy.com/p/63950.html上一篇: PDF不会呈现通过产品中的资产同步托管的HTML和CSS资产
下一篇: pdf无法呈现pdf 500错误