使用pivotal-tracker gem时,为什么我在libxml_ruby.bundle中出现分段错误?

时间:2011-09-20 00:33:27

标签: ruby rubygems

我有一个Ruby 1.9.2-p290程序正在使用pivotal-tracker gem。应用程序环境的配置使用RVM。当我在一台机器上执行此操作时,应用程序按预期在另一台机器上工作,导致下面的错误。

为了简化问题,我创建了一个只包含以下内容的新ruby文件,但仍然收到错误:

require 'pivotal-tracker'
puts 'hello'

鉴于这适用于一台机器而非另一台机器,我假设两者之间存在某种配置差异。

调试导致此错误的最佳方法是什么?

提前谢谢!

> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/libxml_ruby.bundle:
> [BUG] Segmentation fault ruby 1.9.2p290 (2011-07-09 revision 32553)
> [x86_64-darwin10.8.0]
> 
> -- control frame ---------- c:0027 p:-540275480 s:0094 b:0094 l:000093
> d:000093 TOP    c:0026 p:---- s:0092 b:0092 l:000091 d:000091 CFUNC 
> :require c:0025 p:0174 s:0088 b:0088 l:000087 d:000087 METHOD
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55
> c:0024 p:0074 s:0081 b:0081 l:000080 d:000080 TOP   
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/libxml.rb:9
> c:0023 p:---- s:0079 b:0079 l:000078 d:000078 FINISH c:0022 p:----
> s:0077 b:0077 l:000076 d:000076 CFUNC  :require c:0021 p:0174 s:0073
> b:0073 l:000072 d:000072 METHOD
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55
> c:0020 p:0011 s:0066 b:0066 l:000065 d:000065 TOP   
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/xml.rb:11
> c:0019 p:---- s:0064 b:0064 l:000063 d:000063 FINISH c:0018 p:----
> s:0062 b:0062 l:000061 d:000061 CFUNC  :require c:0017 p:0174 s:0058
> b:0058 l:000057 d:000057 METHOD
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55
> c:0016 p:0035 s:0051 b:0051 l:000050 d:000050 TOP   
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/happymapper-0.3.2/lib/happymapper.rb:3
> c:0015 p:---- s:0049 b:0049 l:000048 d:000048 FINISH c:0014 p:----
> s:0047 b:0047 l:000046 d:000046 CFUNC  :require c:0013 p:0174 s:0043
> b:0043 l:000042 d:000042 METHOD
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55
> c:0012 p:0035 s:0036 b:0036 l:000035 d:000035 TOP   
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/pivotal-tracker-0.4.1/lib/pivotal-tracker.rb:3
> c:0011 p:---- s:0034 b:0034 l:000033 d:000033 FINISH c:0010 p:----
> s:0032 b:0032 l:000031 d:000031 CFUNC  :require c:0009 p:0073 s:0028
> b:0028 l:000024 d:000027 BLOCK 
> <internal:lib/rubygems/custom_require>:33 c:0008 p:0014 s:0025 b:0025
> l:000024 d:000024 METHOD <internal:lib/rubygems/custom_require>:29
> c:0007 p:0011 s:0020 b:0020 l:000019 d:000019 TOP   
> /Users/isuttle/Projects/amazon_tracker/amzn_iteration.rb:1 c:0006
> p:---- s:0018 b:0018 l:000017 d:000017 FINISH c:0005 p:---- s:0016
> b:0016 l:000015 d:000015 CFUNC  :require c:0004 p:0013 s:0012 b:0012
> l:000011 d:000011 METHOD <internal:lib/rubygems/custom_require>:29
> c:0003 p:0011 s:0007 b:0007 l:0014d8 d:001660 EVAL   sample.rb:1
> c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000
> s:0002 b:0002 l:0014d8 d:0014d8 TOP   
> 
> Ruby level backtrace information sample.rb:1:in `<main>'
> <internal:lib/rubygems/custom_require>:29:in `require'
> <internal:lib/rubygems/custom_require>:29:in `require'
> /Users/isuttle/Projects/amazon_tracker/amzn_iteration.rb:1:in `<top
> (required)>' <internal:lib/rubygems/custom_require>:29:in `require'
> <internal:lib/rubygems/custom_require>:33:in `rescue in require'
> <internal:lib/rubygems/custom_require>:33:in `require'
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/pivotal-tracker-0.4.1/lib/pivotal-tracker.rb:3:in
> `<top (required)>'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/happymapper-0.3.2/lib/happymapper.rb:3:in
> `<top (required)>'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/xml.rb:11:in
> `<top (required)>'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/gems/ruby-1.9.2-p290/gems/libxml-ruby-1.1.4/lib/libxml.rb:9:in
> `<top (required)>'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'
> /Users/isuttle/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in
> `require'

1 个答案:

答案 0 :(得分:3)

看起来libxml-ruby是segfaulting的部分。我之前已经有了这个,当系统库可能通过以下方式更新时:

  • 系统更新(例如Snow Leopard to Lion)
  • 套餐更新(例如,Homebrew或Macports)

libxml-ruby是针对库libxml2的特定版本编译的,如果库随后更新,它有时会工作一段时间,但通常是不稳定的(如下所示)。您可以尝试通过执行以下操作强制重新编译:

$ gem uninstall libxml-ruby
$ gem install pivotal-tracker