简体   繁体   中英

Rails - cannot run rake command because of “libMagickCore.5.dylib”

When I run run rake db:create , I get this error statement:

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/libjpeg.8.dylib
  Referenced from: /usr/local/opt/imagemagick/lib/libMagickCore.5.dylib
  Reason: Incompatible library version: libMagickCore.5.dylib requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0 - /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `block in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
/Users/adam/rubydev/app-staging/config/application.rb:13:in `<top (required)>'
/Users/adam/rubydev/app-staging/Rakefile:5:in `require'
/Users/adam/rubydev/app-staging/Rakefile:5:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

I spent whole afternoon with looking for an issue and how to fix it, but without success.

The problematic part is here:

  Referenced from: /usr/local/opt/imagemagick/lib/libMagickCore.5.dylib
  Reason: Incompatible library version: libMagickCore.5.dylib requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0 - /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle

How can I upgrade libMagickCore.5.dylib on OS X Lion?

Thank you in advance

EDIT: After reinstalling imagemagick I ran rake db:create and got:

rake db:createrake 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/opt/imagemagick/lib/libMagickCore.5.dylib
  Referenced from: /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
  Reason: image not found - /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `block in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
/Users/adam/rubydev/app-staging/config/application.rb:13:in `<top (required)>'
/Users/adam/rubydev/app-staging/Rakefile:5:in `require'
/Users/adam/rubydev/app-staging/Rakefile:5:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

Try gem pristine rmagick from the command-line.

Reference: https://github.com/mroth/lolcommits/issues/65

I had a similar problem in the past and simply ran a software update on the operating system and on the developer tools.

If that doesn't solve the problem, you can also try removing and reinstalling imagemagic with homebrew by running:

brew update
brew remove imagemagick
brew install imagemagick

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM