本文介绍了用RMagick安装错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去,我使用了RMagick,也有Imagemagick,最近我捆绑安装了一个更新版本的RMagick。

重新启动我的Rails服务器时出现错误。所以我决定卸载第一个imagemagick(从brew),然后卸载rmagick。

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

 错误:执行gem时(Errno :: EACCES)
权限被拒绝 - /Users/username/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper

我也尝试过使用 sudo / p>

 错误:执行gem时(Errno :: EACCES)
权限被拒绝 - / Users / username /。 rvm / gems / ruby​​-1.9.3 -p194 / bin / ruby​​_noexec_wrapper
usercomputer:〜用户名$ sudo gem install rmagick -v'2.13.1'
构建原生扩展。这可能需要一段时间...
错误:安装rmagick时出错:
错误:无法构建gem本机扩展。

/Users/username/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
检查Ruby版本> = 1.8.5 ...是
extconf.rb:128:使用RbConfig而不是过时的和不赞成使用的配置。
检查/usr/bin/gcc-4.2 ...是
检查Magick-config ...否
无法安装RMagick 2.13.1。在/Users/username/.rvm/gems/ruby-1.9.3-p194/bin:/Users/Aurelien/.rvm/gems/ruby-1.9.3-p194@global/bin中找不到Magick-config: /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 /斌:/Users/username/.rvm/bin:在/ usr / bin中:/ bin中:/ usr / sbin目录:/ sbin目录:在/ usr / local / bin目录:在/ usr /本地/ git的/ bin中: / usr / X11 / bin

*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--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文件将继续安装在/Users/username/.rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.1中进行检查。
记录到/Users/username/.rvm/gems/ruby-1.9.3-p194/gems/rmagick-2.13.1/ext/RMagick/gem_make.out



当然,我一路上做错了一些事情,但我不确定是什么?

感谢您的回答。

解决方案

ImageMagick的最新版本似乎与RMagick不兼容。我解决了这个问题:




In the past I used RMagick and also had Imagemagick, and recently I bundle installed a newer version of RMagick.

When restarting my rails server I got errors. So I decided to uninstall first imagemagick (from brew) and then uninstall rmagick.

I tried re-installing rmagick and I am some trouble (first one being I can't install from the bundle command). I tried gem install rmagick -v '2.13.1' but I get the following permission error:

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

I also tried with the sudo and got

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

Surely I have done something wrong along the way, but I am not sure what?

Thank you for you answers.

解决方案

It seems the latest version of ImageMagick is not compatible with RMagick. I solved the issue by following this:

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

这篇关于用RMagick安装错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 16:25