Forum: Ruby on Rails WickedPdf error in production

Posted by Saravanan P (Guest)
on 2013-01-31 05:54
(Received via mailing list)
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
Posted by Khizer Mehdi (Guest)
on 2013-01-31 14:58
(Received via mailing list)
Hi Saravanan,

 Try below steps :

1. Download wicked pdf file
 if your machine is 64 bit
http://wkhtmltopdf.googlecode.com/files/wkhtmltopd...

if your machine is 32 bit
http://wkhtmltopdf.googlecode.com/files/wkhtmltopd...


2. 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

4.  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.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.