rmagick / rmagick

Ruby bindings for ImageMagick
https://rmagick.github.io/
MIT License
694 stars 140 forks source link

Installation fails on Windows with latest ImageMagick #1584

Closed Watson1978 closed 1 week ago

Watson1978 commented 1 week ago

Description

Steps to Reproduce

  1. Install ImageMagick-7.1.1-31
  2. After then, install RMagick.
$ gem i rmagick
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby33-x64/lib/ruby/gems/3.3.0/gems/rmagick-5.5.0/ext/RMagick
C:/Ruby33-x64/bin/ruby.exe extconf.rb
checking for Ruby version >= 2.3.0... yes
checking for magick... yes
checking for outdated ImageMagick version (<= 6.7.7)... no
checking for g++... yes
searching PATH for the ImageMagick library...

ERROR: Can't install RMagick 5.5.0.
Can't find the ImageMagick library.

Please check PATH environment variable for ImageMagick installation path.

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include=${opt-dir}/include
        --without-opt-include
        --with-opt-lib=${opt-dir}/lib
        --without-opt-lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby33-x64/bin/$(RUBY_BASE_NAME)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Ruby33-x64/lib/ruby/gems/3.3.0/extensions/x64-mingw-ucrt/3.3.0/rmagick-5.5.0/mkmf.log

extconf failed, exit code 1

System Configuration

Watson1978 commented 1 week ago

ImageMagick-7.1.1-29-Q16-HDRI-x64-dll

29

The ImageMagick installer has Install development headers and libraries for C and C++ option. When turn on the option, it install libraries into C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\lib.

PS C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\lib> dir

    ディレクトリ: C:\Program Files\ImageMagick-7.1.1-Q16-HDRI\lib

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        2024/02/25     14:02        1077758 CORE_RL_Magick++_.lib
-a----        2024/02/25     14:01         221716 CORE_RL_MagickCore_.lib
-a----        2024/02/25     14:02         154540 CORE_RL_MagickWand_.lib

ImageMagick-7.1.1-30-Q16-HDRI-x64-dll

30

The option changed to Install development headers for C and C++.

Watson1978 commented 1 week ago

@dlemstra The latest ImageMagick installer does not install CORE_RL_MagickCore_.lib. Therefore it causes RMagick installation failure.

What would be the best way to deal with this? Or would ImageMagick be able to handle this?

Watson1978 commented 1 week ago

Reported the issue to ImageMagick

Watson1978 commented 1 week ago

Downloading and installing the installer from https://github.com/rmagick/ImageMagick-binaries, it would be a temporary workaround