[英]Rails + Mac OS X: libMagickCore-Q16.7.dylib doesn't work
If I run some kind of rake
command, I get this error message: 如果我运行某种
rake
命令,我收到此错误消息:
rake aborted!
dlopen(/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libfreetype.6.dylib
Referenced from: /usr/local/lib/libMagickCore-Q16.7.dylib
Reason: Incompatible library version: libMagickCore-Q16.7.dylib requires version 16.0.0 or later, but libfreetype.6.dylib provides version 13.0.0 - /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
...
I am running on RoR 3.2, OSX Lion. 我在RoR 3.2,OSX Lion上运行。
Could anyone help me, please, how to fix this issue? 任何人都可以帮助我,如何解决这个问题? I spent 2 days of googling, reading discussions, but unfortunately with zero success...
我花了2天的谷歌搜索,阅读讨论,但遗憾的是没有成功...
Thank you so much! 非常感谢!
Using Homebrew I was able to solve it using the following commands: 使用Homebrew我能够使用以下命令解决它:
brew uninstall freetype
brew update
brew install freetype
Update step might be unnecessary. 更新步骤可能是不必要的。 The installation succeeded but with the following warning:
安装成功但出现以下警告:
Warning: Could not link freetype. Unlinking...
So one final command: 所以最后一个命令:
brew link --overwrite freetype
I have an amazing how-to-install-rmagick that have been working beautifully for me, try to re-install ImageMagick following these steps: 我有一个令人惊奇的安装方法,它对我来说很漂亮,尝试按照以下步骤重新安装ImageMagick:
yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel -y
(I use CentOS, you can translate the commands to your distro) yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel -y
(我使用CentOS,你可以将命令翻译成你的发行版) wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
and press Enter. wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
并按Enter键。 ImageMagick.tar.gz is created in the current directory. tar xczf ImageMagick.tar.gz
and press Enter. tar xczf ImageMagick.tar.gz
并按Enter键。 A new directory, ImageMagick-version, where version is the ImageMagick version number, is created. ./configure --prefix=/usr/local --without-perl
and press Enter. ./configure --prefix=/usr/local --without-perl
并按Enter键。 make
and press Enter. make
并按Enter键。 ImageMagick compiles. make install
and press Enter. make install
并按Enter键。 rm -r ImageMagick.tar.gz
and press Enter. rm -r ImageMagick.tar.gz
然后按Enter键。 echo export PATH="/usr/local/bin:$PATH" >> ~/.bash_profile
and press Enter. echo export PATH="/usr/local/bin:$PATH" >> ~/.bash_profile
并按Enter键。 source ~/.bash_profile
and press Enter. source ~/.bash_profile
并按Enter键。 export LD_LIBRARY_PATH=/usr/local/lib
and press Enter. export LD_LIBRARY_PATH=/usr/local/lib
并按Enter键。 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
and press Enter. export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
并按Enter键。 Tell me later how it goes. 稍后告诉我它是怎么回事。
I found the answer in another post: 我在另一篇文章中找到了答案:
Rails 3 - RMagick doesn't find libfreetype.6.dylib using Paperclip Rails 3 - RMagick使用Paperclip找不到libfreetype.6.dylib
I performed the search and found that there was an older version of libfreetype that was being referenced and newer versions hidden elsewhere. 我执行了搜索,发现有一个旧版本的libfreetype被引用,而较新版本隐藏在其他地方。 By copying/linking the newer versions into the appropriate directory (/usr/local/lib in my case) the problem was resolved.
通过将较新版本复制/链接到相应的目录(在我的情况下为/ usr / local / lib),问题得以解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.