gpt4 book ai didi

ruby-on-rails - "[BUG] Segmentation fault"怎么解决?

转载 作者:数据小太阳 更新时间:2023-10-29 06:41:48 24 4
gpt4 key购买 nike

我使用的是运行 Snow Leopard 10.6.8 和 RVM 1.10.3、Ruby 1.9.3-p125、Ruby on Rails 3.2.2 和 rspec-rails-2.8.1 的 Mac 操作系统。我已经正确安装并配置了所有 gem,但是在终端窗口中运行 rake spec 命令时,我得到以下信息:

$ rake spec
/<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:10: [BUG] Segmentation fault
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0]

-- Control frame information -----------------------------------------------
c:0045 p:0011 s:0136 b:0136 l:000135 d:000135 CLASS /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:10
c:0044 p:0011 s:0134 b:0134 l:000133 d:000133 CLASS /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:4
c:0043 p:0021 s:0132 b:0132 l:000131 d:000131 TOP /<ABSOLUT_PATH>/.rvm/gems/ruby-
1.9.3-p125/gems/yard-0.7.5/lib/yard/cli/command.rb:3
c:0033 p:0220 s:0104 b:0104 l:0020f0 d:0020f0 TOP /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/yard-0.7.5/lib/yard.rb:57
c:0032 p:---- s:0101 b:0101 l:000100 d:000100 FINISH
c:0031 p:---- s:0099 b:0099 l:000098 d:000098 CFUNC :require
c:0030 p:0026 s:0095 b:0095 l:000380 d:000470 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:68
c:0029 p:---- s:0092 b:0092 l:000091 d:000091 FINISH
c:0028 p:---- s:0090 b:0090 l:000089 d:000089 CFUNC :each
c:0027 p:0091 s:0087 b:0087 l:000380 d:000408 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:66
c:0026 p:---- s:0081 b:0081 l:000080 d:000080 FINISH
c:0025 p:---- s:0079 b:0079 l:000078 d:000078 CFUNC :each
c:0024 p:0046 s:0076 b:0076 l:000380 d:000380 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler/runtime.rb:55
c:0023 p:0021 s:0072 b:0072 l:0004e0 d:0004e0 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/bundler-1.1.0/lib/bundler.rb:118
c:0022 p:0089 s:0068 b:0068 l:000548 d:000548 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/config/application.rb:7
c:0021 p:---- s:0066 b:0066 l:000065 d:000065 FINISH
c:0020 p:---- s:0064 b:0064 l:000063 d:000063 CFUNC :require
c:0019 p:0026 s:0060 b:0060 l:0005a8 d:0005a8 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/config/environment.rb:2
c:0018 p:---- s:0058 b:0058 l:000057 d:000057 FINISH
c:0017 p:---- s:0056 b:0056 l:000055 d:000055 CFUNC :require
c:0016 p:0058 s:0052 b:0052 l:000608 d:000608 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/spec/spec_helper.rb:3
c:0015 p:---- s:0050 b:0050 l:000049 d:000049 FINISH
c:0014 p:---- s:0048 b:0048 l:000047 d:000047 CFUNC :require
c:0013 p:0011 s:0044 b:0044 l:000668 d:000668 TOP /<ABSOLUT_PATH>/Sites/<APPLICATION_NAME>/spec/controllers/users_controller_spec.rb:1
c:0012 p:---- s:0042 b:0042 l:000041 d:000041 FINISH
c:0011 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC :load
c:0010 p:0025 s:0036 b:0036 l:0006c8 d:000730 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698
c:0009 p:---- s:0033 b:0033 l:000032 d:000032 FINISH
c:0008 p:---- s:0031 b:0031 l:000030 d:000030 CFUNC :map
c:0007 p:0023 s:0028 b:0028 l:0006c8 d:0006c8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698
c:0006 p:0074 s:0025 b:0025 l:0007a8 d:0007a8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:22
c:0005 p:0055 s:0020 b:0020 l:000820 d:000820 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80
c:0004 p:0101 s:0014 b:0014 l:0008a8 d:0008a8 METHOD /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69
c:0003 p:0021 s:0007 b:0006 l:001788 d:000908 BLOCK /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002388 d:002388 TOP

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

See Crash Report log file under ~/Library/Logs/CrashReporter or
/Library/Logs/CrashReporter, for the more detail of.

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

* Loaded script: /<ABSOLUT_PATH>/.rvm/gems/ruby-1.9.3-p125/bin/rspec

* Loaded features:

0 enumerator.so
1 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/encdb.bundle
2 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/x86_64-darwin10.8.0/enc/trans/transdb.bundle
3 /<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/defaults.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

rake aborted!
/<ABSOLUT_PATH>/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -S rspec ./spec/controllers/users_controller_spec.rb ... failed

我该如何解决这个问题?

注意:我注意到问题有时会发生,随机发生!


在我的 Gemfile 中我有:

...

group :development, :test do
gem "rspec-rails"
gem 'webrat'
end

group :test do
gem 'factory_girl_rails'
gem 'cucumber-rails'
gem 'turn', :require => false
end

...

最佳答案

已编辑:根据您目前提供的信息,您似乎发现了 Ruby 1.9.3 中的错误。我建议您将此报告给 Ruby 核心团队。

在修复此错误之前,您必须找到解决方法。要找到绕过它的方法,您必须获得更多详细信息,了解什么会触发它,什么不会触发它。

在您发布的堆栈跟踪中,bundler/runtime.rb 的第 68 行似乎需要 yard gem。使用 Ruby 1.9.3,尝试自己从 IRB 或简单的测试脚本中获取 yard gem。这会触发错误吗?如果不是,请转到“realer”在“bundler”中调用的方法(bundler.rb,第 118 行)。尝试从测试脚本中自己调用该方法(无论它是什么)。这会触发错误吗? ...等等。

幸运的是,当你安装Ruby gems时,“gems”目录下有源代码,你可以研究和修改它。在解决问题之前,我还不得不“破解”我的 gem 的源代码(直到发布 gem 的固定版本)。

关于ruby-on-rails - "[BUG] Segmentation fault"怎么解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9751235/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com