使用RMagick安装Gem错误

时间:2013-01-16 10:07:24

标签: ruby-on-rails gem rmagick

过去我使用过RMagick并且还使用了Imagemagick,最近我捆绑了一个更新版本的RMagick。

重新启动rails服务器时出错。所以我决定卸载第一个imagemagick(来自brew),然后卸载rmagick。

我尝试重新安装rmagick并且我遇到了麻烦(首先是我无法从bundle命令安装)。我尝试了gem install rmagick -v '2.13.1',但我收到以下权限错误:

ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /Users/username/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper

我也试过了sudo并得到了

ERROR:  While executing gem ... (Errno::EACCES)
Permission denied - /Users/username/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper
usercomputer:~ Username$ sudo gem install rmagick -v '2.13.1'
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    ERROR: Failed to build gem native extension.

    /Users/username/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
extconf.rb:128: Use RbConfig instead of obsolete and deprecated Config.
checking for /usr/bin/gcc-4.2... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config in /Users/username/.rvm/gems/ruby-1.9.3-p194/bin:/Users/Aurelien/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/username/.rvm/rubies/ruby-1.9.3-p194/bin:/Applications/MAMP/bin/php5/bin:/Applications/MAMP/htdocs/cake/cake/cake/console:/Users/username/.rvm/gems/ruby-1.9.3-p194/bin:/Users/username/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/username/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/username/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/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
--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/username/.rvm/rubies/ruby-1.9.3-p194/bin/ruby


Gem files will remain installed in /Users/username/.rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/username/.rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

我一路上做错了什么,但我不确定是什么?

谢谢你的答案。

1 个答案:

答案 0 :(得分:2)

似乎最新版本的ImageMagick与RMagick不兼容。我通过以下方式解决了这个问题:

http://blog.paulopoiati.com/2013/01/28/installing-rmagick-in-mac-os-x-mountain-lion-with-homebrew/