我在安装rmagick过程中遇到了困难。我的项目使用ruby on rails框架进行开发。我在gemfile中包含了rmagick gem。但是我遇到了以下错误信息:
checking for ImageMagick version >= 6.4.9... no
Can't install RMagick 2.13.4. You must have ImageMagick 6.4.9 or later.
我已经使用brew安装了imagemagick:
imagemagick-6.8.9-8 already installed
ImageMagick文件夹位于/usr/local/Cellar目录下。
在我的终端中:
Zoulfias-iMac:Myapp zoulfiahall$ rvm use ruby-2.0.0-p481
Using /Users/zoulfiahall/.rvm/gems/ruby-2.0.0-p481
Zoulfias-iMac:Myapp zoulfiahall$ sudo gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/Users/zoulfiahall/.rvm/rubies/ruby-2.0.0-p481/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for /usr/bin/clang... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... no
Can't install RMagick 2.13.4. You must have ImageMagick 6.4.9 or later.
*** 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/zoulfiahall/.rvm/rubies/ruby-2.0.0-p481/bin/ruby
extconf failed, exit code 1
Gem files will remain installed in /Users/zoulfiahall/.rvm/rubies/
ruby-2.0.0- p481/lib/ruby/gems/2.0.0/gems/rmagick-2.13.4 for inspection.
Results logged to /Users/zoulfiahall/.rvm/rubies/
ruby-2.0.0- p481/lib/ruby/gems/2.0.0/extensions/x86_64-darwin-13/
2.0.0-static/rmagick-2.13.4/gem_make.out
非常感谢您的咨询。我们很乐意为您提供帮助。
#apt install ruby-rmagick
- mohit