Bundle無法在Mac OSX 10.7上安裝RMagick gem

[英]Bundle can't install RMagick gem on Mac OSX 10.7


I've installed ImageMagick with ImageMagick installer script https://github.com/maddox/magick-installer. I am on OSX Lion 10.7, using RVM, Ruby 1.9.3p125.

我已經用ImageMagick安裝程序腳本https://github.com/maddox/magick-installer安裝了ImageMagick。我使用的是OSX Lion 10.7,使用的是RVM, Ruby 1.9.3p125。

The problem seems to be with MagickWand.h here is the complete log

問題似乎在於魔術棒。這是完整的對數

/Users/pdjimeno/.rvm/rubies/ruby-1.9.3-p125/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... 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... no

Can't install RMagick 2.13.1. Can't find MagickWand.h.
*** 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/pdjimeno/.rvm/rubies/ruby-1.9.3-p125/bin/ruby

12 个解决方案

#1


24  

I suggest that you use brew to manage your binary dependencies. You can easily install imageMagick with brew, like this:

我建議您使用brew來管理二進制依賴項。您可以輕松安裝imageMagick與brew,如下:

brew install imagemagick

This is what I have on my system:

這就是我的系統:

imagemagick 6.7.1-1
http://www.imagemagick.org
Depends on: jpeg, libtiff, little-cms, jasper
/usr/local/Cellar/imagemagick/6.7.1-1 (1389 files, 32M)
http://github.com/mxcl/homebrew/commits/master/Library/Formula/imagemagick.rb

And I have the same setup as you have in terms of machine and ruby-version.

我有和你們一樣的機器和ruby版本。

#2


38  

fix this setting the include path of your current imagemagick installation:

修正當前imagemagick安裝的包含路徑:

Install ImageMagick with brew

安裝ImageMagick和啤酒

brew install imagemagick

find library

找到圖書館

$ mdfind MagickWand.h
/usr/local/Cellar/imagemagick/6.7.5-7/include/ImageMagick/wand/MagickWand.h

Install rmagick gem

安裝rmagick寶石

$ C_INCLUDE_PATH=/path gem install rmagick

example:

例子:

$ C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.5-7/include/ImageMagick/ gem install rmagick

#3


25  

If you're getting Package xxx was not found.

如果你收到包裹xxx沒有被找到。

Find the package and add it's dir path to the PKG_CONFIG_PATH variable in your ~/.bash_login or ~/.bash_profile file.

找到包並將它的目錄路徑添加到~/中的PKG_CONFIG_PATH變量。bash_login或~ /。bash_profile文件。

Example:

例子:

If you get the error:

如果你犯了錯誤:

Package MagickCore was not found in the pkg-config search path.

Find where the file is:

查找文件的位置:

$ mdfind magickcore.pc
/usr/local/homebrew/Cellar/imagemagick/6.7.7-6/lib/pkgconfig/MagickCore.pc

Add to your bash_login or bash_profile:

添加到bash_login或bash_profile:

export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:/usr/local/homebrew/Cellar/imagemagick/6.7.7-6/lib/pkgconfig/:$PKG_CONFIG_PATH"

出口PKG_CONFIG_PATH = " / opt /地方/ lib / pkgconfig:/ usr /地方/自釀酒酒窖/ imagemagick / 6.7.7-6 / lib / pkgconfig /:$ PKG_CONFIG_PATH "

remember to source the bash_login/profile file

記住要將bash_login/profile文件作為源文件

#4


14  

Also found a solution using homebrew:

也找到了一種使用homebrew的解決方案:

brew remove --force pkg-config
brew install pkg-config

and then

然后

gem install rmagick

#5


8  

1) install by installer

1)通過安裝程序安裝

http://cactuslab.com/imagemagick/

http://cactuslab.com/imagemagick/

2) try gem install rmagick

2)嘗試gem安裝rmagick

if checking for wand/MagickWand.h... no
type

如果檢查棒/ MagickWand.h……沒有類型

mdfind MagickWand.h

find some thing like

找到一些事

/Users/user/ImageMagick-6.8.3/include/ImageMagick-6/wand/MagickWand.h

and type in terminal

和類型的終端

C_INCLUDE_PATH=/Users/user/ImageMagick-6.8.3/include/ImageMagick-6/ gem install rmagick

if, after that you have this error (because a had it) "Package MagickCore was not found in the pkg-config search path."

如果,之后你有這個錯誤(因為a有)“在pkg-config搜索路徑中找不到軟件包MagickCore。”

type

類型

mdfind MagickCore.pc

find some thing like /opt/ImageMagick/lib/pkgconfig/MagickCore.pc

找到一些東西,像/opt/ImageMagick/lib/pkgconfig/MagickCore.pc

and finally in terminal type:

最后是終端類型:

PKG_CONFIG_PATH=/opt/ImageMagick/lib/pkgconfig/ gem install rmagick

#6


7  

At the time of writing this, imagemagick 7 is the default version installed via brew install imagemagick, but is incompatible with rmagick. Fix this by:

在撰寫本文時,imagemagick 7是通過brew安裝imagemagick安裝的默認版本,但與rmagick不兼容。解決這個問題:

  1. Remove currently installed version of imagemagick with homebrew
  2. 刪除當前安裝版本的imagemagick與自制軟件

brew uninstall imagemagick

釀造卸載imagemagick

  1. Install imagemagick 6:
  2. 安裝imagemagick 6:

brew install imagemagick@6

釀造安裝imagemagick@6

  1. Run gem install with pkgconfig variable (may have to sudo depending on your config)
  2. 使用pkgconfig變量運行gem安裝(根據配置可能需要sudo)

PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick

PKG_CONFIG_PATH = / usr /地方/ opt / imagemagick@6 / lib / pkgconfig gem安裝rmagick

#7


5  

Andrey Yasinishyn's solution worked for me:

Andrey Yasinishyn的解決方案對我起了作用:

mdfind MagickCore.pc

find some thing like /opt/ImageMagick/lib/pkgconfig/MagickCore.pc

找到一些東西,像/opt/ImageMagick/lib/pkgconfig/MagickCore.pc

and finally in terminal type:

最后是終端類型:

PKG_CONFIG_PATH=/opt/ImageMagick/lib/pkgconfig/ gem install rmagick

#8


3  

When I came up against this issue, it was complaining it couldn't find MagickCore.pc, so I did this;

當我遇到這個問題時,它總是抱怨找不到魔法石。pc,我這么做了;

$ mdfind MagickCore.h
/usr/local/Cellar/imagemagick/6.8.0-10/include/ImageMagick/magick/MagickCore.h
/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/magick/MagickCore.h

$ export PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.8.0-10/lib/pkgconfig/
$ gem install rmagick

and it worked!

並且它成功了!

#9


1  

I had to add both the env variables to make it work. Something like this

我必須添加兩個env變量才能使它工作。像這樣的東西

C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.7.7-6/include/ImageMagick/ PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/Cellar/imagemagick/6.7.7-6/lib/pkgconfig/ gem install rmagick 

#10


1  

For what it is worth I had this problem with Ruby ree-1.8.7-2012-02. Here's how I fixed it:

我在Ruby ree-1.8.7-2012-02中遇到了這個問題。我是這樣修復的:

I removed ImageMagick and re-installed it

我刪除了ImageMagick並重新安裝它

brew remove imagemagick 
brew install imagemagick --disable-openmp --build-from-source

I then added these symbolic links in /usr/local/Cellar/imagemagick/6.8.9-7/lib/

然后我在/usr/local/ cellar /imagemagick/ 6.9 -7/lib/中添加了這些符號鏈接

ln -s libMagick++-6.Q16.5.dylib libMagick++.dylib
ln -s libMagickCore-6.Q16.2.dylib libMagickCore.dylib
ln -s libMagickWand-6.Q16.2.dylib libMagickWand.dylib

I then removed the Ruby version and re-installed it

然后我刪除了Ruby版本並重新安裝了它

rvm remove ree-1.8.7-2012-02
rvm install ree-1.8.7-2012-02

Finally installed the Gem

最后安裝的寶石

gem install rmagick -v '2.12.2'

Hope this helps.

希望這個有幫助。

#11


1  

For El Capitan Users,

對於埃爾卡皮坦用戶來說,

Both PKG_CONFIG_FILE and C_INCLUDE_PATH needs to be included. The command that worked for me is:

需要包括PKG_CONFIG_FILE和C_INCLUDE_PATH。對我起作用的命令是:

sudo C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.9.2-4/include/ImageMagick/ PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.9.2-4/lib/pkgconfig/ gem install rmagick

sudo C_INCLUDE_PATH=/usr/local/Cellar/imagemagick/6.9.2-4/include/ imagemagick/ PKG_CONFIG_PATH=/usr/local/Cellar/imagemagick/6.9.2-4/lib/pkgconfig/ gem安裝rmagick

#12


1  

I tried everything, but what ended up being the solution was:

我嘗試了所有的方法,但最終的解決方案是:

brew uninstall --force imagemagick # removes all versions

brew uninstall——force imagemagick #刪除所有版本

then

然后

brew install imagemagick@6

釀造安裝imagemagick@6

finally

最后

gem install rmagick

gem安裝rmagick


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2012/04/08/99f997ac30a0b03e47547313bc91b558.html



 
  © 2014-2022 ITdaan.com 联系我们: