Rails:运行 wkhtmltopdf 时出错——(加载共享库时出错) [英] Rails: Error running wkhtmltopdf -- (error while loading shared libraries)
问题描述
当我的应用程序运行(或当我从命令行运行)wkhtmltopdf 命令时,我收到以下错误:(从命令行显示)
When my app runs (or when I run from commandline) the wkhtmltopdf command I get the following error: (showing it from command line)
#> wkhtmltopdf
wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory
我注意到 lib 确实在 /usr/lib
文件夹中,但不在 /lib
文件夹中.它在其中的哪一个重要吗?有什么办法让它认出来吗?
I noticed the lib is indeed in the /usr/lib
folder but not the /lib
folder. Does it matter which one of these it is in? Is there any way to get it to recognize it?
#> ls -l /usr/lib/libXrender.so*
lrwxrwxrwx 1 root root 19 Feb 17 07:20 /usr/lib/libXrender.so -> libXrender.so.1.3.0
lrwxrwxrwx 1 root root 19 Feb 17 07:20 /usr/lib/libXrender.so.1 -> libXrender.so.1.3.0
-rwxr-xr-x 1 root root 39184 Jan 29 2010 /usr/lib/libXrender.so.1.3.0
#> ls -l /lib/libXrender.so*
ls: cannot access /lib/libXrender.so*: No such file or directory
我还检查了 lib 的依赖项
I also checked dependencies of the lib
# ldd /usr/lib/libXrender.so.1
libX11.so.6 => /usr/lib/libX11.so.6 (0x00002b9cb5afd000)
libc.so.6 => /lib/libc.so.6 (0x00002b9cb5e04000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x00002b9cb6143000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00002b9cb6347000)
libdl.so.2 => /lib/libdl.so.2 (0x00002b9cb654d000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)
这是在 EngineYard gentoo 服务器上运行
This is running on an EngineYard gentoo server
推荐答案
Unix 包 x11-libs/libXext 和 x11-libs/libXrender 是依赖项
The Unix packages x11-libs/libXext and x11-libs/libXrender are dependencies
Gentoo:
sudo emerge libXext libXrender
PDFkit wiki 还更详细地解释了如何让 wkhtmltopdf 在引擎场上工作.PDFkit wiki
PDFkit wiki also explains in more detail how to get wkhtmltopdf working on engine yard. PDFkit wiki
Debian 或 Ubuntu:
Debian or Ubuntu:
sudo apt-get install libxrender1
希望能帮到你
这篇关于Rails:运行 wkhtmltopdf 时出错——(加载共享库时出错)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!