我正在使用gem“wicked\u pdf”将html转换为pdf。
它在开发模式下运行良好。但在生产中,它抛出了一个错误的nginx。这是生产中的错误日志:
I, [2017-10-17T12:34:09.726920 #17004] INFO -- : [4a94b9f6-fdf6-4e55-b325-9b3096132d4e] Completed 500 Internal Server Error in 2638ms (ActiveRecord: 30.6ms)
F, [2017-10-17T12:34:09.729566 #17004] FATAL -- : [4a94b9f6-fdf6-4e55-b325-9b3096132d4e]
F, [2017-10-17T12:34:09.729763 #17004] FATAL -- : [4a94b9f6-fdf6-4e55-b325-9b3096132d4e] RuntimeError (Failed to execute:
["/home/deploy/phoenix/shared/bundle/ruby/2.4.0/bin/wkhtmltopdf", "-q", "file:////tmp/wicked_pdf20171017-17004-ps7ahv.html", "/tmp/wicked_pdf_generated_file20171017-17004-17rkfch.pdf"]
Error: PDF could not be generated!
Command Error: /home/deploy/phoenix/shared/bundle/ruby/2.4.0/gems/wkhtmltopdf-binary-0.12.3.1/bin/wkhtmltopdf_linux_amd64: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory
):
F, [2017-10-17T12:34:09.729900 #17004] FATAL -- : [4a94b9f6-fdf6-4e55-b325-9b3096132d4e]
F, [2017-10-17T12:34:09.730005 #17004] FATAL -- : [4a94b9f6-fdf6-4e55-b325-9b3096132d4e] app/controllers/orders_controller.rb:16:in `block (2 levels) in show'
[4a94b9f6-fdf6-4e55-b325-9b3096132d4e] app/controllers/orders_controller.rb:13:in `show'
我说我对缺少lib:libXrender有一个问题。所以1.
我正在生产ubuntu 16.04 ruby:2.4.1和rails 5.1.4
我能得到你的支持吗?