Ruby gem rmagick不会安装在Mac OS X上

knu*_*urb 12 ruby macos operating-system rubygems rmagick

我知道这个问题早已被提出过很多问题,但没有一个解决方案适合我,我现在真的很绝望.

我正在尝试使用gem安装rMagick来安装侨民.我已经通过自制软件安装了imagick,并且在尝试运行gem install rmagick时收到此错误:

ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

        /Users/tobischweiger/.rvm/rubies/ruby-1.9.3-p385/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc-4.2... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /Users/tobischweiger/.rvm/gems/ruby-1.9.3-p385@diaspora/bin:/Users/tobischweiger/.rvm/gems/ruby-1.9.3-p385@global/bin:/Users/tobischweiger/.rvm/rubies/ruby-1.9.3-p385/bin:/Users/tobischweiger/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin

*** 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=/Users/tobischweiger/.rvm/rubies/ruby-1.9.3-p385/bin/ruby


Gem files will remain installed in /Users/tobischweiger/.rvm/gems/ruby-1.9.3-p385@diaspora/gems/rmagick-2.13.2 for inspection.
Results logged to /Users/tobischweiger/.rvm/gems/ruby-1.9.3-p385@diaspora/gems/rmagick-2.13.2/ext/RMagick/gem_make.out
Run Code Online (Sandbox Code Playgroud)

我对宝石和自制软件不是很有经验,我想知道是否有人可以帮助我.

dep*_*epa 22

在尝试安装gem之前运行此命令(使用自制软件).

brew install imagemagick
Run Code Online (Sandbox Code Playgroud)


anq*_*egi 15

这是使用自制软件的破坏性较小的版本,rmagic也不能与imagemacigk版本7一起使用

ImageMagick版本6.4.9或更高版本(6.×.x).版本7尚不支持; ETA 2019年4月(https://github.com/rmagick/rmagick/pull/299)

(来自自述文件)

.你可以从www.imagemagick.org获得ImageMagick.所以用brew尝试这个

brew install imagemagick@6
PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick
Run Code Online (Sandbox Code Playgroud)