Library not loaded:libMagickCore-Q16.7.dylib (LoadError)な時
テスト環境
- Mac OS X 10.9.1
- ruby 1.9.3p429
Ruby で ImageMagick を使おうとしたら下記のようなエラーが表示されました。
[shell]
/Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require’: dlopen(/Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libMagickCore-Q16.7.dylib (LoadError)
Referenced from: /Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/lib/RMagick2.bundle
Reason: image not found – /Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/lib/RMagick2.bundle
from /Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require’
from /Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `
from /Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require’
from /Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require’
from /Users/XXXXXXXXXXX/.rbenv/versions/1.9.3-p429/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require’
from resizer.rb:4:in `
[/shell]
(XXXXXXXXXXXはユーザー名です)
ImageMagick と rmagick を再インストールしてみても結果は同じだった時・・・
[shell]
$ gem pristine rmagick
[/shell]
このコマンドを実行してみたら幸せになれるかも・・・。
自分はなれました!