ActiveStorage mupdf on heroku?

I’m struggling with getting mupdf functioning on heroku and wondering if anyone can provide some details (I’m assuming Basecamp has it functioning…and, I believe they are hosted on Heroku).

I’ve upgraded to rails 5.2 and am implementing ActiveStorage. I have successfully installed mutool locally using homebrew and everything works great. However, PDFs do not process on Heroku.

mutool is a bit confusing. Rails docs require “mutool”, Homebrew installs “mupdf-tools”, Heroku wants “mupdf”.

I have successfully installed apt and mupdf on heroku following these steps:

  • 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 builds successful during the push

heroku buildpacks now returns

  1. https://github.com/heroku/heroku-buildpack-apt

  2. heroku/ruby

If I refresh a page calling for a variant on a PDF, the image fails to process and the job kicks back the following error:

Errno::ENOENT: No such file or directory - mutool

It seems mutool and mupdf are synonomous…so, I tried swapping out mutool for mupdf in my Aptfile…that failed to build from "…not found’.

Anyone know what action I need to take?

PS: This is part of implementing rails 5.2 using ActiveStorage.

UPDATE

I added mupdf-tools to Aptfile and that seems to fix the “no such file or directory” error. I don’t know for sure because a new errors surfaces

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.

This mailing list (rubyonrails-core) is intended for discussion about development of the framework itself, not usage of it.

For support issues or usage questions like this one that are not issues with Rails itself, please post to the rubyonrails-talk mailing list (http://groups.google.com/group/rubyonrails-talk) or somewhere like StackOverflow using the ruby-on-rails tag (http://stackoverflow.com/questions/tagged/ruby-on-rails). You can also drop in to the #rubyonrails channel on irc.freenode.net for realtime help. You’ll be more likely to get a quick answer using one of those options.