Ruby: Install ImageMagick when rmagick or mini_magick gems are detected
Feature request
When using the heroku buildpack, no further configuration was needed to deploy an app that depends on ImageMagick.
In a ruby project, when a Gemfile contains either rmagick or mini_magick, nixpacks should automatically add imagemagick nix package as well as the libimagemagick-dev apt package to allow these gems to install successfully without any manual configuration on the user side.
Motivation
ImageMagick is required to be installed when using popular image processing gems such as paperclip or carrierwave. Transitively, these depend on rmagick or mini_magick.
With the experience of using Heroku build packs, I expected this to just work, however required me to add:
NIXPACKS_PKGS=imagemagick
NIXPACKS_APT_PKGS=libimagemagick-dev
Contribution
(not familiar with how to approach this, was requested by fp on Discord to file this)
Would it be sufficient to read the lockfile to determine if rmagick or mini_magick were implicitly dependended on?
I could read the Gemfile but that doesn't seem bulletproof. Thoughts @subdigital?
Yes, Gemfile.lock is the right place
Sent from my iPhone
On Aug 22, 2022, at 6:29 PM, Jake Cooper @.***> wrote:
Would it be sufficient to read the lockfile to determine if rmagick or mini_magick were implicitly dependended on?
I could read the Gemfile but that doesn't seem bulletproof. Thoughts @subdigital?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
@subdigital Do you have an example repo that we could pull in to write tests around and build a solution on?
Here is my Gemfile.lock
https://gist.github.com/subdigital/acb89c13dc005c0c26297194650a0fb2
You'd want to look for rmagick or minimagick
@JakeCooper Can I work on this?
@JakeCooper Can I work on this?
Sure!
I think this issue can be closed now since a PR was already merged