Rails: Error running wkhtmltopdf — (error while loading shared libraries)

前端 未结 11 1566
一向
一向 2021-02-04 23:12

When my app runs (or when I run from commandline) the wkhtmltopdf command I get the following error: (showing it from command line)

#> wkhtmltopdf 
wkhtmltopd         


        
相关标签:
11条回答
  • 2021-02-04 23:46

    Note that there is an executable version of wkhtmltopdf distributed in a UPX compressed format, ldd and file will both report that this file is statically linked even though the payload requires shared libraries.

    To check try

    strings | fgrep UPX

    If you see any "UPX" id strings then install upx and use "upx -d" on a copy of the file (as upx works in place) and then run ldd on the uncompressed file.

    0 讨论(0)
  • 2021-02-04 23:48

    Ran into this today on a RHEL7 machine running the static version of wkhtmltopdf. Solution was to install a few dependencies:

    yum install libXrender libXext fontconfig 
    
    0 讨论(0)
  • 2021-02-04 23:49

    I need also do after:

    sudo apt-get install libfontconfig1
    
    0 讨论(0)
  • 2021-02-04 23:49

    sudo apt-get install xvfb

    to install the dependency package.

    Update the node-modules wkhtmltopdf index.js

    wkhtmltopdf.command = 'wkhtmltopdf'; to 'wkhtmltopdf.command = 'xvfb-run wkhtmltopdf';'

    0 讨论(0)
  • 2021-02-04 23:50

    I was having the exact same problem! The solution, to me, was to install the 64bit version of wkhtmltoimage.

    0 讨论(0)
  • 2021-02-04 23:51

    With Ubuntu 16 (from a fresh Docker install):

    apt install -y libxrender1 libxext6

    0 讨论(0)
提交回复
热议问题