在Ubuntu 10.04 Lucid webserver (linode)上工作。
按照这些说明安装 wkhtmltopdf 链接(只有一个对我有用。
我可以运行wkhtmltopdf http://www.google.com google.pdf
并且它可以工作。
我的 rails 应用程序中的任何内容都会生成 500 错误。阿帕奇错误.log
/bin/wkhtmltopdf: symbol lookup error: /bin/wkhtmltopdf: undefined symbol: _ZN9QListData11detach_growEPii
轨道日志
Rendered customers/agreement_form.html.erb (15.0ms)
Completed 200 OK in 19ms (Views: 16.6ms | ActiveRecord: 0.6ms)
RuntimeError (command failed: /bin/wkhtmltopdf --encoding UTF-8 --page-size A4 --margin-top 0.5in --margin-right 0.75in --margin-bottom 0.5in --margin-left 0.75in --print-media-type --quiet - -):
app/middleware/flash_session_cookie_middleware.rb:19:in `call'
编辑
ldd /bin/wkhtmltopdf
linux-gate.so.1 => (0xf57fe000)
libwkhtmltox.so.0 => /lib/libwkhtmltox.so.0 (0xb7718000)
libQtWebKit.so.4 => /root/sources/wkqt/lib/libQtWebKit.so.4 (0xb64cd000)
libQtSvg.so.4 => /root/sources/wkqt/lib/libQtSvg.so.4 (0xb6473000)
libQtXmlPatterns.so.4 => /root/sources/wkqt/lib/libQtXmlPatterns.so.4 (0xb6047000)
libQtGui.so.4 => /root/sources/wkqt/lib/libQtGui.so.4 (0xb5551000)
libQtNetwork.so.4 => /root/sources/wkqt/lib/libQtNetwork.so.4 (0xb5423000)
libQtCore.so.4 => /root/sources/wkqt/lib/libQtCore.so.4 (0xb517c000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb5163000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb506c000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb5046000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb5027000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb4ecd000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb4ec3000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb4e92000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb4e1c000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb4e0c000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb4cef000)
libz.so.1 => /lib/libz.so.1 (0xb4cda000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb4cd3000)
librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb4cca000)
libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0xb4c00000)
libpng12.so.0 => /lib/libpng12.so.0 (0xb4bdb000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb4b9c000)
libSM.so.6 => /usr/lib/libSM.so.6 (0xb4b92000)
libICE.so.6 => /usr/lib/libICE.so.6 (0xb4b79000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb4b75000)
/lib/ld-linux.so.2 (0xb7781000)
libexpat.so.1 => /lib/libexpat.so.1 (0xb4b4e000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb4b34000)
libpcre.so.3 => /lib/libpcre.so.3 (0xb4b02000)
libuuid.so.1 => /lib/libuuid.so.1 (0xb4afd000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb4af9000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb4af3000)
通常,您的 RoR 应用程序将以与root
不同的用户身份运行:也许是www-data
,也许是另一个系统帐户。
用户是否可以读取该目录中的/root/sources/wkqt/lib/libQtSvg.so.4
和所有其他库?
您可能需要更改以下各项的权限:
/root
/root/sources
/root/sources/wkqt
/root/sources/wkqt/lib
以允许每个人读取和执行权限。您可以使用ls -l
检查权限;使用 chmod(1)
设置权限:
chmod 755 /root /root/sources /root/sources/wkqt /root/sources/wkqt/lib
chmod 644 /root/sources/wkqt/lib/*so*
为了在运行时链接,链接器ld.so(8)
需要能够读取库和所有目录以访问库。