WickedPdf error in production

Hello everyone,

I am using rails -v 3.2.8.
I am using wickedpdf to generate pdf. Its working well in my local
machine.
But its not working in production server.

ompleted 500 Internal Server Error in 4443ms

RuntimeError (Failed to execute:
“/var/www/apps/staging/shared/bundle/ruby/1.9.1/bin/wkhtmltopdf” -q
“file:///tmp/wicked_pdf_5855_0.html”
“/tmp/wicked_pdf_generated_file_5855_0.pdf”
Error: PDF could not be generated!):

Any Idea!

Thank You

Hi Saravanan,

Try below steps :

  1. Download wicked pdf file
    if your machine is 64 bit
    http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2

if your machine is 32 bit
http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2

  1. cd /usr/local/bin
    extract the zipped file inside /usr/loca/bin folder using command

if your prodcution machine is 32 bit tar -xvjf
wkhtmltopdf-0.9.9-static-i386.tar.bz2
if your machine is 64 bit tar -xvjf
wkhtmltopdf-0.9.9-static-amd64.tar.bz2

3.if your machine is 32 bit sudo mv wkhtmltopdf-0.9.9-static-i386
wkhtmltopdf
if your machine is 64 bit sudo mv wkhtmltopdf-0.9.9-static-amd64
wkhtmltopdf

  1. vi project_folder/vendor/plugin/wickedpdf/lib/wicked_pdf.rb
    in the method def pdf_from_string

add a line i.e (setting a path) @exe_path="/usr/local/bin/wickedpdf"
b4 the line command ="#{@exe_path}…etc "

Regards
Mehdi

sudo mv
4.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs