0

right now i'm generate pdf using wkhtmltopdf gem.In development it is working fine. if i'm run my project in production i got this error.already i'm install these two gems "wkhtmltopdf" & "wkhtmltopdf_binary".please help me.

RuntimeError (Failed to execute: "/usr/local/rvm/gems/ruby-1.9.2-p290/bin/wkhtmltopdf" -q - - Error: PDF could not be generated!):

chandrashekar
  • 609
  • 2
  • 7
  • 16

1 Answers1

0

you can try by the following:

  1. Uninstall the wkhtmltopdf package: sudo apt-get remove wkhtmltopdf --purge
  2. (in usr/local/bin) sudo curl -C - -O http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
  3. (in usr/local/bin) sudo tar -xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
  4. (in usr/local/bin) ln -s wkhtmltopdf-amd64 wkhtmltopdf
  5. In your initializer WickedPdf.config = { :exe_path => "/usr/local/bin/wkhtmltopdf" }

Note,you can get more wkhtmltopdf depend on your system: http://code.google.com/p/wkhtmltopdf/downloads/list

and you must remove the gem wkhtmltopdf_binary

liZhang
  • 11
  • 3