LoginSignup
13
8

More than 5 years have passed since last update.

OS X + RMagickの'png.la'と'libMagickCore-6.Q16.1.dylib'がロード出来ない件について

Last updated at Posted at 2014-07-24

昔インストールしたrmagickが動けなくなりました。

$ ruby lib/rmagick.rb 
lib/rmagick.rb:7:in `read': unable to load module `/usr/local/Cellar/imagemagick/6.8.6-3/lib/ImageMagick//modules-Q16/coders/png.la': file not found @ error/module.c/OpenModule/1277 (Magick::ImageMagickError)
    from lib/rmagick.rb:7:in `crop'
    from lib/rmagick.rb:14:in `<main>'

Googleしたら、これで解決したようです。

$ brew uninstall imagemagick
$ brew uninstall libtool
$ brew install libtool --universal
$ brew install imagemagick --build-from-source

が、再度プログラムを実行しようとすると、別のエラーが出ました。

$ ruby lib/rmagick.rb 
/Users/liubin/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': dlopen(/Users/liubin/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libMagickCore-6.Q16.1.dylib (LoadError)

また面倒くさそうですが、これも簡単に解決しました。

$ gem pristine rmagick
Restoring gems to pristine condition...
Building native extensions.  This could take a while...
Restored rmagick-2.13.2
13
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
8