升级到OSX Mavericks 10.9后运行Rails S时出现Rmagick错误 [英] Rmagick errors when running Rails S after upgrading to OSX Mavericks 10.9

查看:364
本文介绍了升级到OSX Mavericks 10.9后运行Rails S时出现Rmagick错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将osx从10.7更新为Mavericks 10.9,从那时起我一直在运行'rails s'问题。

问题在于Rmagick和我已经尝试了几乎所有我能找到的解决方案。大多数人建议通过自制软件重新安装imagemagick,然后重新安装rmagick gem,但这并不奏效。我甚至卸载了整个自制软件,并重新安装了它。我试图摆脱gemfile.lock,并再次运行捆绑软件安装,但没有一个工作。



这是我尝试运行rails本地时得到的错误消息服务器:

  Kibaeks-MacBook-Pro:onvard_saas kibaek $ rails s 
/Users/kibaek/.rvm/gems /ruby-2.1.0@onvard/gems/rmagick-2.13.2/lib/rmagick.rb:11:in'require':dlopen(/Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/ /usr/local/lib/libMagickCore.5.dylib(LoadError)
参考:/Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/extensions/x86_64-darwin-12/2.1.0-static/rmagick-2.13.2/RMagick2.bundle
原因: image not found - /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/extensions/x86_64-darwin-12/2.1.0-static/rmagick-2.13.2/RMagick2.bundle
from /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/gems/rmagick-2.13.2/lib/rmagick.rb:11:in`< top(required)>'
from /Users/kibaek/.rvm/gems/ruby -2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:在'require'中
来自/Users/kibaek/.rvm/gems/ruby-2.1.0@ global / gems / bundler-1.5.1 / lib / bundler / runtime.rb:76:在`block(2 levels)in require'
from /Users/kibaek/.rvm/gems/ruby-2.1.0 @ global / gems / bundler-1.5.1 / lib / bundler / runtime.rb:72:在`each'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/ bundler-1.5.1 / lib / bundler / runtime.rb:72:在`block in require'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5 .1 / lib / bundler / runtime.rb:61:在`each'中
来自/Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/ bundler / runtime.rb:61:在'require'中
来自/Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler.rb:131 :在`require'
/Users/kibaek/onvard_saas/config/application.rb:13:in`< top(required)>'
from /Users/kibaek/.rvm/gems /ruby-2.1.0@onvard/gems/railties-3.2.16/lib/rails/commands.rb:53:in`require'
from /Users/kibaek/.rvm/gems/ ruby-2.1.0@onvard/gems/railties-3.2.16/lib/rails/commands.rb:53:在/ block / in /顶部(必填)>'
from / Users / kibaek /。 rvm/gems/ruby-2.1.0@onvard/gems/railties-3.2.16/lib/rails/commands.rb:50:在'tap'中
从/Users/kibaek/.rvm/gems/ruby -2.1.0@onvard/gems/railties-3.2.16/lib/rails/commands.rb:50:在< top(required)>'脚本/导轨中
:6:在'require '
from script / rails:6:'< main>'


解决方案

我在OS 10.9上也遇到了麻烦。我尝试了很多东西,这对我来说很有用(安装Xcode 5之后):

  brew install libtool --universal 
brew链接libtool

快速调查发现其他用户也获得了成功: p>

堆栈溢出:rmagick-安装后错误-os-x-mavericks



TheKUnit博客:RMagick错误,运行rake任务os x maverick



编辑:另一种可能性是,您拥有与gem正在查找的不同版本的RMagick(可能来自重新安装)。你的日志显示你的宝石正在寻找/usr/local/lib/libMagickCore.5.dylib,我猜它找不到。 Do

  ls / usr / local / lib / 

并查看是否可以找到该文件。如果没有,一个

  gem pristine rmagick 

可能会有帮助,如果您还没有尝试过。在我的情况下,我在该文件夹中有Core 6,而不是5。


I updated my osx to Mavericks 10.9 from 10.7, and since then I have been having issues running 'rails s'.

The issue is with Rmagick, and I have tried almost every solution that I could find. Most people recommended reinstalling imagemagick through homebrew, and reinstalling rmagick gem, but that didn't work. I even uninstalled homebrew as a whole, and reinstalled it. I tried getting rid of gemfile.lock, and running bundle install again, but none of these worked.

Here is the error message I get when I try running the rails local server:

Kibaeks-MacBook-Pro:onvard_saas kibaek$ rails s
/Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `require': dlopen(/Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/extensions/x86_64-darwin-12/2.1.0-static/rmagick-2.13.2/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libMagickCore.5.dylib (LoadError)
Referenced from: /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/extensions/x86_64-darwin-12/2.1.0-static/rmagick-2.13.2/RMagick2.bundle
Reason: image not found - /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/extensions/x86_64-darwin-12/2.1.0-static/rmagick-2.13.2/RMagick2.bundle
from /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/gems/rmagick-2.13.2/lib/rmagick.rb:11:in `<top (required)>'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `require'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `each'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `block in require'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `each'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `require'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.1/lib/bundler.rb:131:in `require'
from /Users/kibaek/onvard_saas/config/application.rb:13:in `<top (required)>'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/gems/railties-3.2.16/lib/rails/commands.rb:53:in `require'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/gems/railties-3.2.16/lib/rails/commands.rb:53:in `block in <top (required)>'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/gems/railties-3.2.16/lib/rails/commands.rb:50:in `tap'
from /Users/kibaek/.rvm/gems/ruby-2.1.0@onvard/gems/railties-3.2.16/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

解决方案

I had trouble with this as well on OS 10.9. I tried many things and this is what worked for me (after installing Xcode 5):

brew install libtool --universal
brew link libtool

Quick research just found the following with other users who also had success:

Stack Overflow: rmagick-error-after-installing-os-x-mavericks

TheKUnit Blog: RMagick errors running rake tasks os x maverick

Edit: Another possibility is that you have a different version of RMagick than the gem is looking for (possibly from the reinstall). Your log shows your gem is looking for /usr/local/lib/libMagickCore.5.dylib which I am guessing it cannot find. Do

 ls /usr/local/lib/

and see if you can find that file. If not, a

gem pristine rmagick

may help if you haven't already tried it. In my case I have Core 6 in that folder and not 5.

这篇关于升级到OSX Mavericks 10.9后运行Rails S时出现Rmagick错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆