【问题标题】:RMagick error after installing OS X Mavericks安装 OS X Mavericks 后出现 RMagick 错误
【发布时间】:2013-10-24 17:57:25
【问题描述】:

我已经安装了 RMagick,并且在 OS X Mountain Lion 中完美运行。我刚刚安装了 OS X Mavericks,当我尝试运行 rails s 时,我收到了这个错误:

/.rvm/gems/ruby-2.0.0-p0@myapp/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require': dlopen(/.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/lib/libltdl.7.dylib (LoadError)
  Referenced from: /.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/RMagick2.bundle
  Reason: image not found - /.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/RMagick2.bundle
    from /.rvm/gems/ruby-2.0.0-p0@myapp/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `block in require'
    from /.rvm/gems/ruby-2.0.0-p0@myapp/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /.rvm/gems/ruby-2.0.0-p0@myapp/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `require'
    from /.rvm/gems/ruby-2.0.0-p0@myapp/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `<top (required)>'
    from /.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.2/lib/bundler/runtime.rb:72:in `require'
    from /.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.2/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.2/lib/bundler/runtime.rb:70:in `each'
    from /.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.2/lib/bundler/runtime.rb:70:in `block in require'
    from /.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.2/lib/bundler/runtime.rb:59:in `each'
    from /.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.2/lib/bundler/runtime.rb:59:in `require'
    from /.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.2/lib/bundler.rb:132:in `require'
    from /myapp/config/application.rb:13:in `<top (required)>'
    from /.rvm/gems/ruby-2.0.0-p0@myapp/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require'
    from /.rvm/gems/ruby-2.0.0-p0@myapp/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /.rvm/gems/ruby-2.0.0-p0@myapp/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap'
    from /.rvm/gems/ruby-2.0.0-p0@myapp/gems/railties-3.2.14/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

这是我的 Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.14'

group :assets do
  gem 'sass-rails',   '>= 3.2.3'
  gem 'coffee-rails', '>= 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

group   :development do
    gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
    gem 'sextant'
  gem "quiet_assets", ">= 1.0.2"
  gem "better_errors", ">= 0.7.2"
  gem "binding_of_caller", ">= 0.7.1"    
    gem 'meta_request'
    gem 'execjs'
    gem 'therubyracer'  
  gem "letter_opener"
  gem 'bullet'   
  gem 'rack-mini-profiler'   
  gem 'mocha', require: false
end

group :test do
  gem "email_spec", ">= 1.4.0"
end

group :development, :test do
  gem "rspec-rails", ">= 2.12.2"
  gem "database_cleaner", ">= 1.0.0.RC1"  
end

gem "stripe"
gem "jquery-rails"
gem "thin", ">= 1.5.0"
gem "pg", ">= 0.15.0"
gem "font-awesome-rails"
gem "bootstrap-sass", ">= 2.3.1.0"
gem "bootstrap-wysihtml5-rails"
gem "sendgrid", ">= 1.0.1"
gem "devise", ">= 2.2.4"
gem "cancan", ">= 1.6.9"
gem "rolify", ">= 3.2.0"
gem "simple_form", ">= 2.1.0"
gem "newrelic_rpm"
gem "rmagick"
gem "mini_magick"
gem "carrierwave"
gem "fog"
gem "rails_admin"
gem "acts-as-taggable-on"
gem "friendly_id"

我已经运行bundle install,一切正常:

$ bundle install
Using rake (10.1.0) 
Using i18n (0.6.5) 
Using multi_json (1.8.2) 
Using activesupport (3.2.14) 
Using builder (3.0.4) 
Using activemodel (3.2.14) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.2.2) 
Using actionpack (3.2.14) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (3.2.14) 
Using arel (3.0.2) 
Using tzinfo (0.3.38) 
Using activerecord (3.2.14) 
Using activeresource (3.2.14) 
Using bundler (1.3.2) 
Using rack-ssl (1.3.3) 
Using json (1.8.1) 
Using rdoc (3.12.2) 
Using thor (0.18.1) 
Using railties (3.2.14) 
Using rails (3.2.14) 
Using acts-as-taggable-on (2.4.1) 
Using addressable (2.3.5) 
Using annotate (2.6.0.beta2) from git://github.com/ctran/annotate_models.git (at master) 
Using atomic (1.1.14) 
Using bcrypt-ruby (3.1.2) 
Using coderay (1.1.0) 
Using better_errors (1.0.1) 
Using debug_inspector (0.0.2) 
Using binding_of_caller (0.7.2) 
Using sass (3.2.12) 
Using bootstrap-sass (2.3.2.2) 
Using bootstrap-wysihtml5-rails (0.3.1.23) 
Using uniform_notifier (1.3.0) 
Using bullet (4.6.0) 
Using callsite (0.0.11) 
Using cancan (1.6.10) 
Using carrierwave (0.9.0) 
Using coffee-script-source (1.6.3) 
Using execjs (2.0.2) 
Using coffee-script (2.2.0) 
Using coffee-rails (3.2.2) 
Using daemons (1.1.9) 
Using database_cleaner (1.2.0) 
Using orm_adapter (0.4.0) 
Using thread_safe (0.1.3) 
Using warden (1.2.3) 
Using devise (3.1.1) 
Using diff-lcs (1.2.4) 
Using launchy (2.3.0) 
Using email_spec (1.5.0) 
Using eventmachine (1.0.3) 
Using excon (0.27.6) 
Using formatador (0.2.4) 
Using net-ssh (2.7.0) 
Using net-scp (1.1.2) 
Using mini_portile (0.5.1) 
Using nokogiri (1.6.0) 
Using ruby-hmac (0.4.0) 
Using unicode (0.4.4) 
Using fog (1.16.0) 
Using font-awesome-rails (3.2.1.3) 
Using friendly_id (4.0.10.1) 
Using haml (4.0.3) 
Using jquery-rails (3.0.4) 
Using jquery-ui-rails (3.0.1) 
Using kaminari (0.14.1) 
Using letter_opener (1.1.2) 
Using libv8 (3.16.14.3) 
Using rack-contrib (1.1.0) 
Using meta_request (0.2.8) 
Using metaclass (0.0.1) 
Using subexec (0.2.3) 
Using mini_magick (3.6.0) 
Using mocha (0.14.0) 
Using nested_form (0.3.2) 
Using newrelic_rpm (3.6.8.164) 
Using pg (0.17.0) 
Using quiet_assets (1.0.2) 
Using rack-mini-profiler (0.1.31) 
Using rack-pjax (0.7.0) 
Using remotipart (1.2.1) 
Using safe_yaml (0.9.7) 
Using sass-rails (3.2.6) 
Using rails_admin (0.4.9) 
Using ref (1.0.5) 
Using rest-client (1.6.7) 
Using rmagick (2.13.2) 
Using rolify (3.2.0) 
Using rspec-core (2.14.6) 
Using rspec-expectations (2.14.3) 
Using rspec-mocks (2.14.4) 
Using rspec-rails (2.14.0) 
Using sendgrid (1.2.0) 
Using sextant (0.2.4) 
Using simple_form (2.1.0) 
Using stripe (1.8.7) 
Using therubyracer (0.12.0) 
Using thin (1.5.1) 
Using uglifier (2.2.1) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

也试过bundle update rmagick:

$ bundle update rmagick
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0) 
Using i18n (0.6.5) 
Using multi_json (1.8.2) 
Using activesupport (3.2.14) 
Using builder (3.0.4) 
Using activemodel (3.2.14) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.3) 
Using tilt (1.4.1) 
Using sprockets (2.2.2) 
Using actionpack (3.2.14) 
Using mime-types (1.25) 
Using polyglot (0.3.3) 
Using treetop (1.4.15) 
Using mail (2.5.4) 
Using actionmailer (3.2.14) 
Using arel (3.0.2) 
Using tzinfo (0.3.38) 
Using activerecord (3.2.14) 
Using activeresource (3.2.14) 
Using bundler (1.3.2) 
Using rack-ssl (1.3.3) 
Using json (1.8.1) 
Using rdoc (3.12.2) 
Using thor (0.18.1) 
Using railties (3.2.14) 
Using rails (3.2.14) 
Using acts-as-taggable-on (2.4.1) 
Using addressable (2.3.5) 
Using annotate (2.6.0.beta2) from git://github.com/ctran/annotate_models.git (at master) 
Using atomic (1.1.14) 
Using bcrypt-ruby (3.1.2) 
Using coderay (1.1.0) 
Using better_errors (1.0.1) 
Using debug_inspector (0.0.2) 
Using binding_of_caller (0.7.2) 
Using sass (3.2.12) 
Using bootstrap-sass (2.3.2.2) 
Using bootstrap-wysihtml5-rails (0.3.1.23) 
Using uniform_notifier (1.3.0) 
Using bullet (4.6.0) 
Using callsite (0.0.11) 
Using cancan (1.6.10) 
Using carrierwave (0.9.0) 
Using coffee-script-source (1.6.3) 
Using execjs (2.0.2) 
Using coffee-script (2.2.0) 
Using coffee-rails (3.2.2) 
Using daemons (1.1.9) 
Using database_cleaner (1.2.0) 
Using orm_adapter (0.4.0) 
Using thread_safe (0.1.3) 
Using warden (1.2.3) 
Using devise (3.1.1) 
Using diff-lcs (1.2.4) 
Using launchy (2.3.0) 
Using email_spec (1.5.0) 
Using eventmachine (1.0.3) 
Using excon (0.27.6) 
Using formatador (0.2.4) 
Using net-ssh (2.7.0) 
Using net-scp (1.1.2) 
Using mini_portile (0.5.1) 
Using nokogiri (1.6.0) 
Using ruby-hmac (0.4.0) 
Using unicode (0.4.4) 
Using fog (1.16.0) 
Using font-awesome-rails (3.2.1.3) 
Using friendly_id (4.0.10.1) 
Using haml (4.0.3) 
Using jquery-rails (3.0.4) 
Using jquery-ui-rails (3.0.1) 
Using kaminari (0.14.1) 
Using letter_opener (1.1.2) 
Using libv8 (3.16.14.3) 
Using rack-contrib (1.1.0) 
Using meta_request (0.2.8) 
Using metaclass (0.0.1) 
Using subexec (0.2.3) 
Using mini_magick (3.6.0) 
Using mocha (0.14.0) 
Using nested_form (0.3.2) 
Using newrelic_rpm (3.6.8.164) 
Using pg (0.17.0) 
Using quiet_assets (1.0.2) 
Using rack-mini-profiler (0.1.31) 
Using rack-pjax (0.7.0) 
Using remotipart (1.2.1) 
Using safe_yaml (0.9.7) 
Using sass-rails (3.2.6) 
Using rails_admin (0.4.9) 
Using ref (1.0.5) 
Using rest-client (1.6.7) 
Using rmagick (2.13.2) 
Using rolify (3.2.0) 
Using rspec-core (2.14.6) 
Using rspec-expectations (2.14.3) 
Using rspec-mocks (2.14.4) 
Using rspec-rails (2.14.0) 
Using sendgrid (1.2.0) 
Using sextant (0.2.4) 
Using simple_form (2.1.0) 
Using stripe (1.8.7) 
Using therubyracer (0.12.0) 
Using thin (1.5.1) 
Using uglifier (2.2.1) 
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

【问题讨论】:

  • 来吧 marcamillion 你知道如何使用 SO,给我们更多的信息!你试过bundle install吗?你尝试过什么?
  • 我用我试过的两个bundle 命令更新了这个问题。

标签: ruby-on-rails ruby macos rmagick osx-mavericks


【解决方案1】:

Install X Code 5,然后这样做:

brew install libtool --universal
brew link libtool

【讨论】:

  • 我应该安装什么版本的 Xcode?刚收到一条消息:Warning: Your Xcode (4.6) is outdated. Please install Xcode 4.6.1. 在安装这些之前我应该​​这样做吗?
  • 我还是安装了 XCode 5。在安装新的 XCode 5 和执行此操作之间 - 现在已修复。
  • 升级到 Mavericks 后运行 rake 时,我也遇到了 错误。只需运行 brew install libtool --universal 命令对我来说就足够了。 (已经升级到最棒的xcode)
猜你喜欢
  • 1970-01-01
  • 2011-05-16
  • 1970-01-01
  • 2014-01-26
  • 2014-03-04
  • 2014-04-09
  • 1970-01-01
  • 2013-11-07
  • 1970-01-01
相关资源
最近更新 更多