RMagick抱怨libMagickCore.5。在OSX中没有发现dylib

时间:2020-12-29 09:00:54

after running brew upgrade imagemagick, when I run rails s I'll get

在运行brew upgrade imagemagick之后,当我运行rails s时,我将获得

/Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require': dlopen(/Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libMagickCore.5.dylib (LoadError)
  Referenced from: /Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/rmagick-2.13.2/lib/RMagick2.bundle
  Reason: image not found - /Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/rmagick-2.13.2/lib/RMagick2.bundle

I'm using Carrierwave gem with RMagick, OS is OSX Moutain Lion

我用的是卡里路波峰宝石和罗奇克,OS是OSX Moutain Lion

5 个解决方案

#1


28  

Anyone else struggling with this right now (Jan 2017) - RMagick 2.15.4 can't be built with ImageMagick 7.0.x

任何人都不能用ImageMagick 7.0.x来构建RMagick 2.15.4

First, please do this:

首先,请这样做:

brew uninstall ImageMagick
gem uninstall rmagick

Second, please see https://github.com/rmagick/rmagick/issues/256 and read the answer by hristozov, viz:

其次,请参见https://github.com/rmagick/rmagick/issues/256,并阅读hristozov的答案,即:

brew rm imagemagick
cd "$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/"
git checkout 6f014f2b7f1f9e618fd5c0ae9c93befea671f8be imagemagick.rb
brew install imagemagick
brew pin imagemagick
git reset --hard

This will force homebrew to use /usr/local/Cellar/imagemagick/6.9.7-3

这将迫使homebrew使用/usr/ local/cellar/imagemagick /6.9.7-3

Third,

第三,

gem install rmagick

#2


26  

thx to bit unrelated answer found here I manage to fix this by:

在这里找到的不相关的答案,我通过以下方法修复了这个问题:

1/ search for this lib in the system

在系统中搜索这个lib。

sudo find / -name "libMagickCore.5.dylib" -print

I found mine in /usr/local/Cellar/imagemagick/6.7.7-6/lib/libMagickCore.5.dylib

我在/ usr/local/cellar/imagemagick /6.7.7-6/lib/ libmagickcore.5 dylib中找到了我的。

2/ link this library to required path

2 .将该库链接到所需的路径

ln /usr/local/Cellar/imagemagick/6.7.7-6/lib/libMagickCore.5.dylib /usr/local/lib/libMagickCore.5.dylib

#3


9  

1 brew uninstall ImageMagick

1酿造卸载ImageMagick

2 brew install ImageMagick

2酿造安装ImageMagick

3 gem uninstall rmagick (all versions)

3 gem卸载rmagick(所有版本)

4 gem install rmagick

4 gem安装rmagick

worked for me

为我工作

#4


4  

Big thanks! I had the same problem:

大感谢!我也有同样的问题:

$ perl -le 'use Image::Magick'

Can't load '/Library/Perl/5.16/darwin-thread-multi-2level/auto/Image/Magick/Magick.bundle' for module Image::Magick: dlopen(/Library/Perl/5.16/darwin-thread-multi-2level/auto/Image/Magick/Magick.bundle, 1): Library not loaded: /usr/local/lib/libMagickCore-6.Q16.1.dylib
Referenced from: /Library/Perl/5.16/darwin-thread-multi-2level/auto/Image/Magick/Magick.bundle Reason: image not found at /System/Library/Perl/5.16/darwin-thread-multi-2level/DynaLoader.pm line 194. at -e line 1. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. &Image::Magick::constant not defined. The required ImageMagick libraries are not installed or not installed properly. END failed--call queue aborted at -e line 1.

不能加载/图书馆/ Perl / 5.16 / darwin-thread-multi-2level /汽车/图像/魔法/魔法。模块映像包::Magick: dlopen(/Library/Perl/5.16/darwin-thread-multi- level/auto/Image/Magick/Magick /Magick)。bundle, 1):未加载的库:/usr/ local/libmagickcore - 6.q16.1。dylib引用:/图书馆/ Perl / 5.16 / darwin-thread-multi-2level /汽车/图像/魔法/魔法。捆绑原因:图片没有在/System/Library/Perl/5.16/darwin-thread-multi-2level/DynaLoader上找到。点194行。- e 1号线。在第1行需要时,编译失败。BEGIN failed——编译在第1行终止。形象:魔法:常数没有定义。所需的ImageMagick库没有正确安装或没有正确安装。结束失败——调用队列在第1行终止。

And after:

后:

$ sudo find / -name "libMagickCore-6.Q16.1.dylib" -print

/usr/local/Cellar/imagemagick/6.8.7-7/lib/libMagickCore-6.Q16.1.dylib

/usr/local/Cellar/imagemagick 6.8.7-7 / lib / libmagickcore q16.1.dylib——6.

I created a symlink:

我创建了一个符号链接:

$ ln -s /usr/local/Cellar/imagemagick/6.8.7-7/lib/libMagickCore-6.Q16.1.dylib /usr/local/lib/libMagickCore-6.Q16.1.dylib

And removed and installed all the imagemagick dependences:

并删除并安装所有imagemagick依赖项:

$ brew install perlmagick

==> Installing dependencies for perlmagick: libpng, imagemagick

=>安装perlmagick: libpng、imagemagick的依赖项

And everything works now.

现在一切正常。

#5


1  

Just this helped me:

这帮助我:

gem pristine rmagick

Thanks to https://github.com/mroth/lolcommits/issues/9#issuecomment-5153570

由于https://github.com/mroth/lolcommits/issues/9 # issuecomment - 5153570

#1


28  

Anyone else struggling with this right now (Jan 2017) - RMagick 2.15.4 can't be built with ImageMagick 7.0.x

任何人都不能用ImageMagick 7.0.x来构建RMagick 2.15.4

First, please do this:

首先,请这样做:

brew uninstall ImageMagick
gem uninstall rmagick

Second, please see https://github.com/rmagick/rmagick/issues/256 and read the answer by hristozov, viz:

其次,请参见https://github.com/rmagick/rmagick/issues/256,并阅读hristozov的答案,即:

brew rm imagemagick
cd "$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/"
git checkout 6f014f2b7f1f9e618fd5c0ae9c93befea671f8be imagemagick.rb
brew install imagemagick
brew pin imagemagick
git reset --hard

This will force homebrew to use /usr/local/Cellar/imagemagick/6.9.7-3

这将迫使homebrew使用/usr/ local/cellar/imagemagick /6.9.7-3

Third,

第三,

gem install rmagick

#2


26  

thx to bit unrelated answer found here I manage to fix this by:

在这里找到的不相关的答案,我通过以下方法修复了这个问题:

1/ search for this lib in the system

在系统中搜索这个lib。

sudo find / -name "libMagickCore.5.dylib" -print

I found mine in /usr/local/Cellar/imagemagick/6.7.7-6/lib/libMagickCore.5.dylib

我在/ usr/local/cellar/imagemagick /6.7.7-6/lib/ libmagickcore.5 dylib中找到了我的。

2/ link this library to required path

2 .将该库链接到所需的路径

ln /usr/local/Cellar/imagemagick/6.7.7-6/lib/libMagickCore.5.dylib /usr/local/lib/libMagickCore.5.dylib

#3


9  

1 brew uninstall ImageMagick

1酿造卸载ImageMagick

2 brew install ImageMagick

2酿造安装ImageMagick

3 gem uninstall rmagick (all versions)

3 gem卸载rmagick(所有版本)

4 gem install rmagick

4 gem安装rmagick

worked for me

为我工作

#4


4  

Big thanks! I had the same problem:

大感谢!我也有同样的问题:

$ perl -le 'use Image::Magick'

Can't load '/Library/Perl/5.16/darwin-thread-multi-2level/auto/Image/Magick/Magick.bundle' for module Image::Magick: dlopen(/Library/Perl/5.16/darwin-thread-multi-2level/auto/Image/Magick/Magick.bundle, 1): Library not loaded: /usr/local/lib/libMagickCore-6.Q16.1.dylib
Referenced from: /Library/Perl/5.16/darwin-thread-multi-2level/auto/Image/Magick/Magick.bundle Reason: image not found at /System/Library/Perl/5.16/darwin-thread-multi-2level/DynaLoader.pm line 194. at -e line 1. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1. &Image::Magick::constant not defined. The required ImageMagick libraries are not installed or not installed properly. END failed--call queue aborted at -e line 1.

不能加载/图书馆/ Perl / 5.16 / darwin-thread-multi-2level /汽车/图像/魔法/魔法。模块映像包::Magick: dlopen(/Library/Perl/5.16/darwin-thread-multi- level/auto/Image/Magick/Magick /Magick)。bundle, 1):未加载的库:/usr/ local/libmagickcore - 6.q16.1。dylib引用:/图书馆/ Perl / 5.16 / darwin-thread-multi-2level /汽车/图像/魔法/魔法。捆绑原因:图片没有在/System/Library/Perl/5.16/darwin-thread-multi-2level/DynaLoader上找到。点194行。- e 1号线。在第1行需要时,编译失败。BEGIN failed——编译在第1行终止。形象:魔法:常数没有定义。所需的ImageMagick库没有正确安装或没有正确安装。结束失败——调用队列在第1行终止。

And after:

后:

$ sudo find / -name "libMagickCore-6.Q16.1.dylib" -print

/usr/local/Cellar/imagemagick/6.8.7-7/lib/libMagickCore-6.Q16.1.dylib

/usr/local/Cellar/imagemagick 6.8.7-7 / lib / libmagickcore q16.1.dylib——6.

I created a symlink:

我创建了一个符号链接:

$ ln -s /usr/local/Cellar/imagemagick/6.8.7-7/lib/libMagickCore-6.Q16.1.dylib /usr/local/lib/libMagickCore-6.Q16.1.dylib

And removed and installed all the imagemagick dependences:

并删除并安装所有imagemagick依赖项:

$ brew install perlmagick

==> Installing dependencies for perlmagick: libpng, imagemagick

=>安装perlmagick: libpng、imagemagick的依赖项

And everything works now.

现在一切正常。

#5


1  

Just this helped me:

这帮助我:

gem pristine rmagick

Thanks to https://github.com/mroth/lolcommits/issues/9#issuecomment-5153570

由于https://github.com/mroth/lolcommits/issues/9 # issuecomment - 5153570