在mac上诊断和修复ruby gem错误的最佳方法

时间:2014-10-25 18:22:14

标签: ruby macos gem

(编辑为包含完整错误消息)

突然任何 gem命令都会引发以下错误:

  

/usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/gems/2.0.0/extensions/x86_64-darwin-12/2.0.0/psych-2.0.6/psych.bundle: [BUG]分段错误   ruby 2.0.0p353(2013-11-22修订版43784)[x86_64-darwin12.5.0]

     

- 崩溃报告日志信息----------------------------------------- ---

     

请参阅以下某项下的崩溃报告日志文件:        *〜/ Library / Logs / CrashReporter        * / Library / Logs / CrashReporter        *〜/ Library / Logs / DiagnosticReports        * / Library / Logs / DiagnosticReports      更详细的。

     

- 控制框架信息------------------------------------------ -----

     

0014:p:-17529742134590 s:0075 e:000074 TOP [FINISH]

     

c:0013 p:---- s:0073 e:000072 CFUNC:require   c:0012 p:0115 s:0069 e:000068 METHOD /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55   c:0011 p:0007 s:0059 e:000058 TOP /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/gems/2.0.0/gems/psych-2.0.6/lib/psych。 rb:1 [完成]   c:0010 p:---- s:0057 e:000056 CFUNC:require   c:0009 p:0115 s:0053 e:000052方法/usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55   c:0008 p:0078 s:0043 e:000042方法/usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb:601   c:0007 p:0013 s:0039 e:000038方法/usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:328   c:0006 p:0145 s:0033 e:000032 METHOD /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:197 [FINISH]   c:0005 p:---- s:0022 e:000021 CFUNC:new   c:0004 p:0018 s:0018 e:000016方法/usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74   c:0003 p:0018 s:0013 e:000012方法/usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:39   c:0002 p:0115 s:0007 E:0015e0 EVAL /usr/local/Cellar/ruby/2.0.0-p353/bin/gem:21 [完]   c:0001 p:0000 s:0002 E:000278 TOP [FINISH]

     

/usr/local/Cellar/ruby/2.0.0-p353/bin/gem:21:in <main>' /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:39:in运行&#39;   /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in do_configuration' /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:74:in new&#39;   /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:197:in initialize' /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb:328:in load_file&#39;   /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb:601:in load_yaml' /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in要求&#39;   /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/gems/2.0.0/gems/psych-2.0.6/lib/psych.rb:1:in&#39;   /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in require' /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in要求&#39;

     

- C级回溯信息----------------------------------------- -

     

- 其他运行时信息------------------------------------------ -----

     
      
  • 已加载的脚本:/usr/local/Cellar/ruby/2.0.0-p353/bin/gem

  •   
  • 已加载的功能:

         

    0 enumerator.so   1 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/enc/encdb.bundle   2 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/enc/trans/transdb.bundle   3 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/rbconfig.rb   4 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/compatibility.rb   5 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/defaults.rb   6 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/deprecate.rb   7 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/errors.rb   8 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/version.rb   9 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb   10 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/platform.rb   11 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/basic_specification.rb   12 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/stub_specification.rb   13 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/util/stringio.rb   14 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb   15 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/exceptions.rb   16 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb   17 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/thread.rb   18 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/monitor.rb   19 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb   20 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems.rb   21 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/optparse.rb   22 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/io/console.bundle   23 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/user_interaction.rb   24 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/command.rb   25 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb   26 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/2.0.0/x86_64-darwin12.5.0/etc.bundle   27 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/config_file.rb   28 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/path_support.rb   29 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb   30 /usr/local/Cellar/ruby/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb

  •   
     

[注]   您可能在Ruby解释器或扩展库中遇到了错误。   欢迎提供错误报告。   有关详细信息:http://www.ruby-lang.org/bugreport.html

     

中止陷阱:6

非常感谢任何见解。

1 个答案:

答案 0 :(得分:0)

在评论中,OP说:

  

实际上,检查应用程序/更新它似乎我的Xcode已更新。但是我没有升级到约塞米蒂。

升级到Apple的Xcode可能会以惊人的方式破坏事物。每当更新Xcode或升级OS X系统库时,它通常可以帮助您完成以下部分或全部操作:

  1. 接受新的Xcode许可协议。即使您之前已经接受了协议,也需要在每次升级后执行此操作。
  2. 再次安装Xcode命令行工具。
  3. 重新安装任何非系统Ruby版本,并使用本机扩展重新编译gem。