Can't install RMagick 0.0.0. Can't find Magick-config

柔情痞子 提交于 2019-12-21 03:58:37

问题


I'm running a debian server and upgraded all packages after quite a while (apt-get update, apt-get upgrade, apt-get distro-upgrade). Then rmagick didn't work anymore becuase imagemagick was updated.

So I ran:

gem uninstall rmagick
bundle install

Then I got this:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 0.0.0. Can't find Magick-config in /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

*** 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
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/bin/ruby

extconf failed, exit code 1

Gem files will remain installed in /srv/www/www.example.com/shared/vendor/bundle/ruby/2.1.0/gems/rmagick-2.13.3 for inspection.
Results logged to /srv/www/www.example.com/shared/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/rmagick-2.13.3/gem_make.out
An error occurred while installing rmagick (2.13.3), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.3'` succeeds before bundling.

This is cat mkmf.log:

    checking for Ruby version >= 1.8.5... -------------------- yes

--------------------

find_executable: checking for gcc... -------------------- yes

--------------------

find_executable: checking for Magick-config... -------------------- no

--------------------

Can't install RMagick 0.0.0. Can't find Magick-config in /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

Can anyone help me with this?


回答1:


For whoever runs into this problem in the future: It took me long but it's fixed. This is what I did:

  • sudo apt-get purge imagemagick libmagickcore-dev libmagickwand-dev
  • sudo rm -R /usr/include/ImageMagick-6/magick
  • sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
  • sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev



回答2:


I think you have to install libmagickwand-dev from the ubuntu archive:

This package included the static libraries needed to compile programs using MagickWand.It contains the MagickWand.h file

This is a transition package that depends on default quantum libmagickwand development files.

sudo apt-get install libmagickwand-dev

After install this dependency you need to install rmagick:

gem install rmagick



回答3:


I'm on mac os, but I had to specify version 6

brew install imagemagick@6
brew link --overwrite --force imagemagick@6



回答4:


apt-get install libmagickcore-dev

worked well for me.




回答5:


In centos 7 I had to do the following to make it work:

 yum install ImageMagick-devel.x86_64

It failed all the time when this package was not installed.




回答6:


Had the same problem, but ImageMagic was installed. Symlinking worked but url is slightly different then answers above. Please pay attention to caps. For Ubuntu 18.04 there are 2 options:

Option 1:

Add symlink:

sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.9.7/bin-q16/Magick-config /usr/bin/Magick-config

Option 2:

Export path in ~/.profile

export PATH="/usr/lib/x86_64-linux-gnu/ImageMagick-6.9.7/bin-q16/:$PATH"


来源:https://stackoverflow.com/questions/28324439/cant-install-rmagick-0-0-0-cant-find-magick-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!