7

我必须使用 rmagick,它不允许我启动 rails 服务器。我在这里和谷歌上读过,到目前为止,没有一个解决方案有帮助。图书馆出了点问题,我不知道如何解决它。

如果有人有解决这个确切问题的建议,将不胜感激。

/Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `require': dlopen(/Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libltdl.7.dylib (LoadError)
  Referenced from: /usr/local/lib/libMagickCore-Q16.7.dylib
  Reason: image not found - /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/RMagick2.bundle
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `<top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:72:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:70:in `each'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:70:in `block in require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:59:in `each'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler/runtime.rb:59:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0@global/gems/bundler-1.3.0/lib/bundler.rb:132:in `require'
    from /Users/lexi87/dating/config/application.rb:7:in `<top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:53:in `require'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:50:in `tap'
    from /Users/lexi87/.rvm/gems/ruby-2.0.0-p0/gems/railties-3.2.12/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
4

4 回答 4

11

我能够修复这个错误,所以如果他们遇到同样的问题,这应该适用于其他任何人。

以下是修复的步骤:

brew uninstall imagemagick
gem uninstall rmagick
sudo gem install json # (not sure this step is needed)
sudo apt-get install libmagick9-dev
bundle install

然后它完美地工作。现在我可以启动 rails 服务器并且不再收到错误消息。希望这对某人有帮助!

于 2013-03-01T19:31:35.553 回答
6

你只需要用你当前的 imagemagick 重新安装 rmagick

gem install rmagick

在其他一些问题中,我发现以下通过使用解决了该问题,

gem pristine rmagick
于 2013-03-01T16:39:41.667 回答
3

我的安装有几个问题,对我有用的是

brew uninstall imagemagick
gem uninstall rmagick
brew install imagemagick
bundle install
brew unlink libtool 
brew link libtool

没有第一个我在尝试安装 rmagick 时遇到错误,如果没有最后两个,则在启动 rails 服务器时出现错误

于 2014-11-20T14:33:00.833 回答
0

我也有这个问题。我尝试了很多不同的技巧,奇怪的是,这种奇怪的东西奏效了。前两个命令似乎没用,但考虑到我不知道它是如何工作的,我也将它们留在里面。

不要问问题,只要运行它们并拥抱 rmagick

brew install libtool --universal
brew link libtool
brew unlink libtool && brew link libtool
gem uninstall rmagick
gem install rmagick
于 2014-09-14T03:24:51.073 回答