3

OS Xにrmagick gemをインストールする際に問題があると思われる多くの投稿を読みましたが、MagickCoreのPATH変数を設定するための解決策はどれもうまくいかないようです。gem をインストールしようとすると、同じスタック トレースが表示され続けます。

これが私が毎回得るものであり、それを乗り越える方法に途方に暮れています。

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

        /Users/mwallace/.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 clang... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... yes
checking for InitializeMagick() in -lMagickCore... no
checking for InitializeMagick() in -lMagick... no
checking for InitializeMagick() in -lMagick++... no
Can't install RMagick 2.13.1. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.

*** 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/mwallace/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
    --with-MagickCorelib
    --without-MagickCorelib
    --with-Magicklib
    --without-Magicklib
    --with-Magick++lib
    --without-Magick++lib


Gem files will remain installed in /Users/mwallace/.rvm/gems/ruby-1.9.3-p194@recruittalk/gems/rmagick-2.13.1 for inspection.
Results logged to /Users/mwallace/.rvm/gems/ruby-1.9.3-p194@recruittalk/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
An error occurred while installing rmagick (2.13.1), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling.
4

2 に答える 2

0

mini_magick gem に切り替えることをお勧めします。ImageMagick が提供するすべての機能を利用できますが、インストールがはるかに簡単で、メモリ フットプリントがいくらか少なくなります。

于 2013-06-21T11:25:14.257 に答える
0

私も同じ問題を抱えています。私はRuby、Rails、Homebrew(そしてもちろんUnixファイル構造)に非常に慣れていないことを言う必要があります...しかし...

PKG_CONFIG_PATH の問題を解決すると、別の問題が発生するのではないかと思います。最初のものでうまくいくかもしれないしうまくいかないかもしれない簡単な提案をしてから、2番目に私が何をしたかを説明します.

まず、どこかでこれを .bashrc に追加する提案を見つけました: PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"。数時間前にこれを行ったので、最初の問題が修正された可能性があります。正確には覚えていませんが。

次に、imagemagick バージョン 6.8 には、これらに必要なメソッドが非推奨になっていると思います。

checking for InitializeMagick() in -lMagickCore... no
checking for InitializeMagick() in -lMagick... no
checking for InitializeMagick() in -lMagick++... no

したがって、以前のバージョンにはまだそれらがあります。パッケージの古いバージョンをインストールするには、こちら (http://wearepandr.com/blog/article/homebrew-and-installing-old-package-versions) の指示に従いました。imagemagick をアンインストールし、/usr/local/Library/Formula/ で提案されたコマンドを実行し、imagemagick を再インストールした後、rmagick gem を正常にインストールできました。6.7.1-1 の種類をランダムに選びました。

依存関係の変更を反映するために、誰かがrmagickを更新する必要があると本当に思います(1年か2年で古くなります)。しかし、私は自分でそれを行うのに十分な知識がありません。

于 2013-01-08T00:27:35.243 に答える