捆绑器在Netbeans 6.9.1上的rmagic 2.13.1失败

时间:2012-08-23 15:10:29

标签: macos imagemagick rmagick

我是RoR& amp;的初学者试图设置Netbeans IDE。有人可以帮我解决Netbeans中rmagick的捆绑错误吗?

我有以下ROR开发环境:

Qadeers-MacBook:gems Qadeer$ rvm info
ruby-1.9.3-p194:
  system:
    uname:       "Darwin Qadeers-MacBook.xxxxxx.com 11.4.0 Darwin Kernel Version 11.4.0"
    bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
    zsh:         "/bin/zsh => zsh 4.3.11 (i386-apple-darwin11.0)"
  rvm:
    version:      "rvm 1.15.5 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "21 hours 49 minutes 4 seconds ago"
  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p194"
    date:         "2012-04-20"
    platform:     "x86_64-darwin11.4.0"
    patchlevel:   "2012-04-20 revision 35410"
    full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]"
  homes:
    gem:          "/Users/Qadeer/.rvm/gems/ruby-1.9.3-p194"
    ruby:         "/Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194"
  binaries:
    ruby:         "/Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
    irb:          "/Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
    gem:          "/Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
    rake:         "/Users/Qadeer/.rvm/gems/ruby-1.9.3-p194@global/bin/rake"
  environment:
    PATH:         "/Users/Qadeer/.rvm/gems/ruby-1.9.3-p194/bin:/Users/Qadeer/.rvm/gems/ruby-1.9.3-p194@global/bin:/Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/Qadeer/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/Cellar/ruby/1.9.3-p194/bin:/usr/X11/bin:/usr/local/git/bin"
    GEM_HOME:     "/Users/Qadeer/.rvm/gems/ruby-1.9.3-p194"
    GEM_PATH:     "/Users/Qadeer/.rvm/gems/ruby-1.9.3-p194:/Users/Qadeer/.rvm/gems/ruby-1.9.3-p194@global"
    MY_RUBY_HOME: "/Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194"
    IRBRC:        "/Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

我正在使用Netbeans IDE 6.9.1并且具有

的gem依赖性
gem "rmagick", ">= 1.15.17"

当我使用bundler在我的gemfile中安装依赖项时,它会失败并显示错误

Installing rmagick (2.13.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/Qadeer/.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 /usr/bin:/bin:/usr/sbin:/sbin

*** 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/Qadeer/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
Gem files will remain installed in /Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/Qadeer/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
An error occured while installing rmagick (2.13.1), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling.

所以,我使用命令

成功地直接安装了gem
Qadeers-MacBook:gems Qadeer$ gem install rmagick -v '2.13.1'
Building native extensions.  This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Installing ri documentation for rmagick-2.13.1...
Installing RDoc documentation for rmagick-2.13.1...

请注意,虽然以上是成功的,但我还是看不到netbeans ruby​​平台屏幕中安装的gem列表中列出的gem。不知道为什么..

我已经知道ImageMagick已安装在我的机器上

Qadeers-MacBook:gems Qadeer$ ruby -rRMagick -e "puts Magick::Long_version"
This is RMagick 2.13.1 ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter
Built with ImageMagick 6.7.7-6 2012-08-23 Q16 http://www.imagemagick.org
Built for ruby 1.9.3
Web page: http://rmagick.rubyforge.org
Email: rmagick@rubyforge.org

在Magick-config文件上执行定位会产生以下路径,因为它是使用brew安装的。

Qadeers-MacBook:gems Qadeer$ locate Magick-config
/usr/local/Cellar/imagemagick/6.7.7-6/bin/Magick-config
/usr/local/Cellar/imagemagick/6.7.7-6/share/man/man1/Magick-config.1
/usr/local/bin/Magick-config
/usr/local/share/man/man1/Magick-config.1

问题是,我如何告诉netbeans使用上面路径中的Magick-config而不只是查看/ usr / bin:/ bin:/ usr / sbin:/ sbin?

非常感谢任何帮助..!

1 个答案:

答案 0 :(得分:0)

这就是答案.. !!!我发布它后几分钟,我发现this link是中文的。虽然我不会说中文,但我只能按照屏幕更新配置文件并重新启动netbeans。而且这种改变是有效的。解决方案只是Netbeans需要/ usr / local / bin的扩展路径变量,它具有Magick-config文件。完成此操作后,IDE就可以安装rmagick。谢谢,并希望这对以后的人有用..