vim下的ruby分段错误

时间:2013-11-27 09:39:45

标签: ruby vim rspec nokogiri

我正在开发vim中的ruby应用程序。当我从vim运行rspec时(使用:!rspec),我得到了这个奇怪的错误。谁能指出我正确的方向并找出问题所在?如果我在vim之外使用spec,为什么会这么好?

rspec spec/telepresence_api/user_spec.rb
/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/nokogiri-1.6.0/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   the more detail of.

-- Control frame information -----------------------------------------------
c:0021 p:-17587624402138 s:0089 e:000088 TOP    [FINISH]
c:0020 p:---- s:0087 e:000086 CFUNC  :require
c:0019 p:0073 s:0083 e:000082 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45
c:0018 p:0186 s:0073 e:000072 TOP    /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/nokogiri-1.6.0/lib/nokogiri.rb:28 [FINISH]
c:0017 p:---- s:0071 e:000070 CFUNC  :require
c:0016 p:0059 s:0067 e:000066 BLOCK  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110
c:0015 p:0286 s:0064 e:000063 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35
c:0014 p:0007 s:0054 e:000053 TOP    /Users/runfor/Projects/telepresence_api/lib/telepresence_api.rb:1 [FINISH]
c:0013 p:---- s:0052 e:000051 CFUNC  :require_relative
c:0012 p:0007 s:0048 e:000047 TOP    /Users/runfor/Projects/telepresence_api/spec/spec_helper.rb:1 [FINISH]
c:0011 p:---- s:0046 e:000045 CFUNC  :require
c:0010 p:0073 s:0042 e:000041 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45
c:0009 p:0007 s:0032 e:000031 TOP    /Users/runfor/Projects/telepresence_api/spec/telepresence_api/user_spec.rb:1 [FINISH]
c:0008 p:---- s:0030 e:000029 CFUNC  :load
c:0007 p:0018 s:0026 e:000025 BLOCK  /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896 [FINISH]
c:0006 p:---- s:0023 e:000022 CFUNC  :each
c:0005 p:0011 s:0020 e:000019 METHOD /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896
c:0004 p:0054 s:0017 e:000016 METHOD /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22
c:0003 p:0101 s:0012 e:000011 METHOD /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80
c:0002 p:0044 s:0005 e:000004 BLOCK  /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17 [FINISH]
c:0001 p:0000 s:0002 E:0005d8 TOP    [FINISH]

/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in `block in autorun'
/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in `run'
/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:22:in `run'
/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load_spec_files'
/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `each'
/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:896:in `load'
/Users/runfor/Projects/telepresence_api/spec/telepresence_api/user_spec.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/Users/runfor/Projects/telepresence_api/spec/spec_helper.rb:1:in `<top (required)>'
/Users/runfor/Projects/telepresence_api/spec/spec_helper.rb:1:in `require_relative'
/Users/runfor/Projects/telepresence_api/lib/telepresence_api.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
/Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/nokogiri-1.6.0/lib/nokogiri.rb:28:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'

-- C level backtrace information -------------------------------------------

-- Other runtime information -----------------------------------------------

* Loaded script: /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/bin/rspec

* Loaded features:

    0 enumerator.so
    1 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/enc/encdb.bundle
    2 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/enc/trans/transdb.bundle
    3 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/rbconfig.rb
    4 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/compatibility.rb
    5 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/defaults.rb
    6 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/deprecate.rb
    7 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/errors.rb
    8 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/version.rb
    9 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/requirement.rb
   10 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/platform.rb
   11 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/specification.rb
   12 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/exceptions.rb
   13 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
   14 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb
   15 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb
   16 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb
   17 

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/path_support.rb
   18 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/set.rb
   19 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/date_core.bundle
   20 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/date/format.rb
   21 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/date.rb
   22 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/time.rb
   23 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/filter_manager.rb
   24 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/dsl.rb
   25 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/extensions/kernel.rb
   26 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/extensions/instance_eval_with_args.rb
   27 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/extensions/module_eval_with_args.rb
   28 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/extensions/ordered.rb
   29 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/deprecation.rb
   30 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/backward_compatibility.rb
   31 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/reporter.rb
   32 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/metadata_hash_builder.rb
   33 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb
   34 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/memoized_helpers.rb
   35 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/metadata.rb
   36 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/pending.rb
   37 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/formatters.rb
   38 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/world.rb
   39 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/etc.bundle
   40 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb
   41 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/backtrace_cleaner.rb
   42 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/pathname.bundle
   43 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb
   44 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/ruby_project.rb
   45 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/formatters/deprecation_formatter.rb
   46 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb
   47 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/project_initializer.rb
   48 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/optparse.rb
   49 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/option_parser.rb
   50 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/cgi/util.rb
   51 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin13/strscan.bundle
   52 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/erb.rb
   53 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/shellwords.rb
   54 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/configuration_options.rb
   55 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb
   56 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb
   57 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/example.rb
   58 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/shared_example_group/collection.rb
   59 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/shared_example_group.rb
   60 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb
   61 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core/version.rb
   62 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/core.rb
   63 /Users/runfor/.rvm/gems/ruby-2.0.0-p247@telepresence/gems/rspec-core-2.14.7/lib/rspec/autorun.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html


Command terminated

Press ENTER or type command to continue

2 个答案:

答案 0 :(得分:4)

发生了,vim加载了不同的ruby版本。 我使用的ruby版本是:

ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.0.0]

但是vim加载了这个:

ruby 2.0.0p247 (2013-06-27 revision 41674) [universal-darwin13.0.0]

This文章解释了为什么会发生这种情况。其中一个原因是我正在使用zsh。所以基本上要解决这个问题我将set shell=/bin/sh添加到我的.vimrc文件中。现在它加载了正确的红宝石。

答案 1 :(得分:0)

似乎与Apple提供的本机库相关联。

我已经通过重新安装ruby解决了这个问题。

rvm reinstall 2.0.0-p247 --disable-binary --autolibs=3