我已经升级到 rails 5.2 并且正在实施 ActiveStorage。ActiveStorage 使用 mutool 进行 PDF 处理。我已经使用自制软件在本地成功安装了 mutool。
mutool is a bit confusing.
rails docs claim to require "mutool",
homebrew installs "mupdf-tools",
and heroku wants "mupdf".
我已经按照以下步骤在heroku上成功安装了apt和mupdf:
- add a new Aptfile to the root of my application with only "mupdf" listed
- commit and push the Aptfile
- THEN run heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
- push again so heroku will finish installing apt and mupdf
mupdf 在推送期间构建成功
heroku buildpacks now returns
1. https://github.com/heroku/heroku-buildpack-apt
2. heroku/ruby
如果我刷新页面以调用 PDF 上的变体,则图像无法处理并且作业会返回以下错误:
Errno::ENOENT: No such file or directory - mutool
似乎 mutool 和 mupdf 是同义词...所以,我尝试在我的 Aptfile 中将 mutool 换成 mupdf...未能从“...未找到”构建。
有人知道我需要采取什么行动吗?
PS:这是使用 ActiveStorage 实现 rails 5.2 的一部分。
更新
我将 mupdf-tools 添加到 Aptfile 中,这似乎解决了“没有这样的文件或目录”错误。我不确定,因为出现了新的错误
MiniMagick::Invalid: `identify /tmp/mini_magick20180105-4-pvub9r` failed with error: identify.im6: no decode delegate for this image format `/tmp/mini_magick20180105-4-pvub9r' @ error/constitute.c/ReadImage/544.
MiniMagick::Error: `identify -format %m %w %h %b /tmp/ActiveStorage20180105-4-1f46tem[0]` failed with error: identify.im6: no decode delegate for this image format `/tmp/ActiveStorage20180105-4-1f46tem' @ error/constitute.c/ReadImage/544.