wicked_pdf does not run on Ubuntu server : wkhtmltopdf: cannot connect to X server

后端 未结 3 829
渐次进展
渐次进展 2021-02-01 08:05

I\'m trying to use wicked_pdf on my prod server but it keeps failling :

RuntimeError (Failed to execute:
\"/usr/bin/wkhtmltopdf\" -q        \"file:////tmp/wicked         


        
3条回答
  •  醉梦人生
    2021-02-01 08:47

    Resolved this problem in this tread https://stackoverflow.com/a/34947479/5320149

    I found method to resolve this problem without fake X server. In newest version of wkhtmltopdf dont need X server for work, but it no into official linux repositories.

    Solution for Ubuntu 14.04.4 LTS (trusty) i386

    $ sudo apt-get install xfonts-75dpi
    $ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-i386.deb
    $ sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-i386.deb
    $ wkhtmltopdf http://www.google.com test.pdf
    

    Solution for Ubuntu 14.04.4 LTS (trusty) amd64

    $ sudo apt-get install xfonts-75dpi
    $ wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.2.1/wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
    $ sudo dpkg -i wkhtmltox-0.12.2.1_linux-trusty-amd64.deb
    $ wkhtmltopdf http://www.google.com test.pdf
    

提交回复
热议问题