首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在heroku上安装mupdf?

如何在heroku上安装mupdf?
EN

Stack Overflow用户
提问于 2018-01-05 08:06:17
回答 2查看 1.1K关注 0票数 3

我已经升级到了Rails5.2,并且正在实现ActiveStorage。ActiveStorage使用mutool进行PDF处理。我已经成功地使用自制软件在本地安装了mutool。

代码语言:javascript
复制
mutool is a bit confusing.  

rails docs claim to require "mutool", 
homebrew installs "mupdf-tools", 
and heroku wants "mupdf".

我已经按照以下步骤在heroku上成功安装了apt和mupdf:

代码语言:javascript
复制
- 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构建成功

代码语言:javascript
复制
heroku buildpacks now returns    
1. https://github.com/heroku/heroku-buildpack-apt
2. heroku/ruby

如果我刷新调用PDF变体的页面,图像无法处理,作业会返回以下错误:

代码语言:javascript
复制
  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,这似乎修复了“没有这样的文件或目录”的错误。我不确定,因为一个新的错误浮出水面

代码语言:javascript
复制
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.
EN

回答 2

Stack Overflow用户

发布于 2018-05-16 06:49:15

出于许可原因(MuPDF具有商业许可证)的Heroku recommends Poppler as an alternative to MuPDF

他们创建了一个涵盖PDF和视频文件的buildpack for Active Storage Previews

票数 4
EN

Stack Overflow用户

发布于 2018-03-15 12:31:57

我知道这有点老了,但是如果您仍然有这个问题,我可以通过将mupdf-tools的版本更新到至少1.8来解决这个问题。

要使用Heroku做到这一点,您需要直接链接到最新版本。

添加heroku-buildpack-apt,然后添加自定义应用程序文件。请注意,您需要首先添加Aptfile,构建包才能正常工作。

下面是我的Aptfile的样子:

代码语言:javascript
复制
:repo:deb http://archive.ubuntu.com/ubuntu artful main universe
imagemagick
ffmpeg
mupdf-tools

要测试您的版本是否正确,可以使用heroku ps:exec进行测试。运行mutool -v,您应该使用的是版本1.11。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48105368

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档