我已经升级到了Rails5.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是synonomous...so,我尝试在我的Aptfile...that中用mutool替换mupdf,但从"...not found“中构建失败。
有人知道我需要采取什么行动吗?
PS:这是使用ActiveStorage实现rails 5.2的一部分。
更新
我在Aptfile中添加了mupdf-tools,这似乎修复了“没有这样的文件或目录”的错误。我不确定,因为一个新的错误浮出水面
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.发布于 2018-05-16 06:49:15
出于许可原因(MuPDF具有商业许可证)的Heroku recommends Poppler as an alternative to MuPDF。
他们创建了一个涵盖PDF和视频文件的buildpack for Active Storage Previews。
发布于 2018-03-15 12:31:57
我知道这有点老了,但是如果您仍然有这个问题,我可以通过将mupdf-tools的版本更新到至少1.8来解决这个问题。
要使用Heroku做到这一点,您需要直接链接到最新版本。
添加heroku-buildpack-apt,然后添加自定义应用程序文件。请注意,您需要首先添加Aptfile,构建包才能正常工作。
下面是我的Aptfile的样子:
:repo:deb http://archive.ubuntu.com/ubuntu artful main universe
imagemagick
ffmpeg
mupdf-tools要测试您的版本是否正确,可以使用heroku ps:exec进行测试。运行mutool -v,您应该使用的是版本1.11。
https://stackoverflow.com/questions/48105368
复制相似问题