PDFKit 不显示上传的回形针图像

PDFKit not showing uploaded paperclip images

我正在使用 PDFKit 在 rails 中生成 PDF,但是当我尝试显示上传的图像时,它不会显示在 PDF 中我不知道我在这里遗漏了什么?谁能告诉我如何实现这一目标?

图片使用绝对路径

来自:https://github.com/pdfkit/pdfkit

Resources aren't included in the PDF: Images, CSS, or JavaScript does not seem to be downloading correctly in the PDF. This is due to the fact that wkhtmltopdf does not know where to find those files. Make sure you are using absolute paths (start with forward slash) to your resources. If you are using PDFKit to generate PDFs from a raw HTML source make sure you use complete paths (either file paths or urls including the domain). In restrictive server environments the root_url configuration may be what you are looking for change your asset host.