I am trying to use CarrierWave in ruby, and it keeps failing.
I managed to reproduce the error with convert
utility.
> convert file.jpg file.bmp
convert: unable to load module `/usr/local/Cellar/imagemagick/6.9.7-3/lib/ImageMagick//modules-Q16/coders/jpeg.la': file not found @ error/module.c/OpenModule/1302.
convert: no decode delegate for this image format `JPEG' @ error/constitute.c/ReadImage/504.
convert: no images defined `file.bmp' @ error/convert.c/ConvertImageCommand/3258.
But I see the file the jpeg.la did exist. I installed ImageMagick using Homebrew (brew install ImageMagick), tried to upgrade to the latest and still it fails.
Any ideas?
Try upgrading imagemagick@6 instead of the plain imagemagick formula.
Around December 2016/January 2017 carrierwave used rmagick, which relied on version 6 of ImageMagick. Around the same time, brew moved to version 7 of ImageMagick. This busted rmagick and carrierwave functionality, so the Hombebrew/core-brew project kindly added an imagemagick@6 formula.
The quick and dirty fix to get carrierwave running was brew install imagemagick@6 && brew link imagemagick@6 --force
.
If this is the case, then brew upgrade imagemagick
will not update the library that rmagick is using. Rather brew upgrade imagemagick@6
would be necessary.
An alternative route may be switching from using rmagick to mini_magick. The mini_magick gem seems to be better maintained as of this writing (2017-Oct-03) as well as appearing to work with the most recent version of imagemagick.