I can't export to PDF (internal server error)
When you try to fo a PDF export which results in an error (or acts as if nothing happens). The production log would list error similar to
Errno::EPIPE (Broken pipe) or wkhtmltopdf: cannot connect to X server
Caused by issues with exporting component wkhtmltopdf
Here are the proposed solutions.
Headless server
Get needed version of wkhtmltopdf from http://wkhtmltopdf.org/downloads.html
Example (you have to work with details of your own environment):
- sudo apt-get install xvfb xauth
- wget https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
- sudo dpkg -i wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
- sudo apt-get -f install
- sudo mv /usr/local/bin/wkhtmltopdf /usr/local/bin/xwkhtmltopdf
- echo 'exec xvfb-run -a -s "-screen 0 640x480x16" xwkhtmltopdf "$@"' | sudo tee /usr/local/bin/wkhtmltopdf >/dev/null
- sudo chmod a+x /usr/local/bin/wkhtmltopdf
Non-headless server only
- You need to have wkhtmltopdf installed on your server in PATH
(apt-get install wkhtmltox, yum install wkhtmltox)
It must be installed in bundler, otherwise it may not work after updating Easy Redmine - Make sure that program works correctly (run from the console for example wkhtmltopdf https://easyredmine.com homepage.pdf)
- re-run rake easyproject:install RAILS_ENV=production
- restart server