gpt4 book ai didi

ruby-on-rails - 中止(核心转储)ruby 错误

转载 作者:数据小太阳 更新时间:2023-10-29 08:31:59 26 4
gpt4 key购买 nike

rake spec
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:67: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0057 p:---- s:0169 b:0169 l:000168 d:000168 CFUNC :initialize
c:0056 p:---- s:0167 b:0167 l:000166 d:000166 CFUNC :new
c:0055 p:0099 s:0164 b:0162 l:000161 d:000161 METHOD /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:67
c:0054 p:0090 s:0153 b:0152 l:000151 d:000151 CLASS /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/ext.rb:17
c:0053 p:0011 s:0150 b:0150 l:000149 d:000149 CLASS /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/ext.rb:12
c:0052 p:0074 s:0148 b:0148 l:000147 d:000147 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/ext.rb:9
c:0051 p:---- s:0146 b:0146 l:000145 d:000145 FINISH
c:0050 p:---- s:0144 b:0144 l:000143 d:000143 CFUNC :require
c:0049 p:0027 s:0140 b:0140 l:000139 d:000139 CLASS /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json.rb:58
c:0048 p:0021 s:0138 b:0138 l:000137 d:000137 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json.rb:54
c:0047 p:---- s:0136 b:0136 l:000135 d:000135 FINISH
c:0046 p:---- s:0134 b:0134 l:000133 d:000133 CFUNC :require
c:0045 p:0011 s:0130 b:0130 l:000129 d:000129 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.1/lib/active_support/core_ext/object/json.rb:2
c:0044 p:---- s:0128 b:0128 l:000127 d:000127 FINISH
c:0043 p:---- s:0126 b:0126 l:000125 d:000125 CFUNC :require
c:0042 p:0107 s:0122 b:0122 l:000121 d:000121 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.1/lib/active_support/core_ext/object.rb:11
c:0041 p:---- s:0120 b:0120 l:000119 d:000119 FINISH
c:0040 p:---- s:0118 b:0118 l:000117 d:000117 CFUNC :require
c:0039 p:0023 s:0114 b:0114 l:000113 d:000113 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/configuration.rb:2
c:0038 p:---- s:0112 b:0112 l:000111 d:000111 FINISH
c:0037 p:---- s:0110 b:0110 l:000109 d:000109 CFUNC :require
c:0036 p:0023 s:0106 b:0106 l:000105 d:000105 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/railtie.rb:2
c:0035 p:---- s:0104 b:0104 l:000103 d:000103 FINISH
c:0034 p:---- s:0102 b:0102 l:000101 d:000101 CFUNC :require
c:0033 p:0011 s:0098 b:0098 l:000097 d:000097 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/engine.rb:1
c:0032 p:---- s:0096 b:0096 l:000095 d:000095 FINISH
c:0031 p:---- s:0094 b:0094 l:000093 d:000093 CFUNC :require
c:0030 p:0071 s:0090 b:0090 l:000089 d:000089 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/application.rb:6
c:0029 p:---- s:0088 b:0088 l:000087 d:000087 FINISH
c:0028 p:---- s:0086 b:0086 l:000085 d:000085 CFUNC :require
c:0027 p:0095 s:0082 b:0082 l:000081 d:000081 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails.rb:11
c:0026 p:---- s:0080 b:0080 l:000079 d:000079 FINISH
c:0025 p:---- s:0078 b:0078 l:000077 d:000077 CFUNC :require
c:0024 p:0011 s:0074 b:0074 l:000073 d:000073 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/all.rb:1
c:0023 p:---- s:0072 b:0072 l:000071 d:000071 FINISH
c:0022 p:---- s:0070 b:0070 l:000069 d:000069 CFUNC :require
c:0021 p:0038 s:0066 b:0066 l:000065 d:000065 TOP /home/starkers/Documents/opensource_projects/gitlabhq/config/application.rb:3
c:0020 p:---- s:0064 b:0064 l:000063 d:000063 FINISH
c:0019 p:---- s:0062 b:0062 l:000061 d:000061 CFUNC :require
c:0018 p:0036 s:0058 b:0058 l:000057 d:000057 METHOD /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36
c:0017 p:0026 s:0051 b:0051 l:000050 d:000050 TOP /home/starkers/Documents/opensource_projects/gitlabhq/Rakefile:5
c:0016 p:---- s:0049 b:0049 l:000048 d:000048 FINISH
c:0015 p:---- s:0047 b:0047 l:000046 d:000046 CFUNC :load
c:0014 p:0013 s:0043 b:0043 l:000042 d:000042 METHOD /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/rake_module.rb:28
c:0013 p:0252 s:0039 b:0039 l:000038 d:000038 METHOD /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:687
c:0012 p:0009 s:0034 b:0034 l:000027 d:000033 BLOCK /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:94
c:0011 p:0007 s:0032 b:0032 l:000031 d:000031 METHOD /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:176
c:0010 p:0011 s:0028 b:0028 l:000027 d:000027 METHOD /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:93
c:0009 p:0019 s:0025 b:0025 l:000018 d:000024 BLOCK /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:77
c:0008 p:0007 s:0023 b:0023 l:000022 d:000022 METHOD /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:176
c:0007 p:0011 s:0019 b:0019 l:000018 d:000018 METHOD /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:75
c:0006 p:0060 s:0016 b:0016 l:000015 d:000015 TOP /home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/bin/rake:33
c:0005 p:---- s:0014 b:0014 l:000013 d:000013 FINISH
c:0004 p:---- s:0012 b:0012 l:000011 d:000011 CFUNC :load
c:0003 p:0167 s:0008 b:0008 l:001ac8 d:001588 EVAL /usr/local/bin/rake:23
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001ac8 d:001ac8 TOP

-- Ruby level backtrace information ----------------------------------------
/usr/local/bin/rake:23:in `<main>'
/usr/local/bin/rake:23:in `load'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:77:in `block in run'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:93:in `load_rakefile'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:94:in `block in load_rakefile'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/application.rb:687:in `raw_load_rakefile'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load'
/home/starkers/Documents/opensource_projects/gitlabhq/Rakefile:5:in `<top (required)>'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/starkers/Documents/opensource_projects/gitlabhq/config/application.rb:3:in `<top (required)>'
/home/starkers/Documents/opensource_projects/gitlabhq/config/application.rb:3:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/all.rb:1:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/all.rb:1:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails.rb:11:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails.rb:11:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/application.rb:6:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/application.rb:6:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/engine.rb:1:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/engine.rb:1:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/railtie.rb:2:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/railtie.rb:2:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/configuration.rb:2:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.1.1/lib/rails/configuration.rb:2:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.1/lib/active_support/core_ext/object.rb:11:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.1/lib/active_support/core_ext/object.rb:11:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.1/lib/active_support/core_ext/object/json.rb:2:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/activesupport-4.1.1/lib/active_support/core_ext/object/json.rb:2:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json.rb:54:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json.rb:58:in `<module:JSON>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json.rb:58:in `require'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/ext.rb:9:in `<top (required)>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/ext.rb:12:in `<module:JSON>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/ext.rb:17:in `<module:Ext>'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:67:in `generator='
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:67:in `new'
/home/starkers/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.1/lib/json/common.rb:67:in `initialize'

-- A lot more stuff here!

[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

Aborted (core dumped)

运行 rake spec 时,我得到了上面的结果。我无法运行我的 Rails 项目。

1) 有人可以解释我如何使用这些信息来查找错误吗?

2) 谁能看到我的个人问题?我正在尝试运行 Gitlab,这是一个相当大的项目,其他人可能会遇到它

3) 如果这确实是一个错误,我该如何解决?更改 rails 版本?更改 ruby 版本?我该怎么做。

我在 Ubuntu 上并通过 RVM 安装。所以我可以通过它改变 ruby 版本。那我的 gem 呢? ~> x.x.x 选项和 bundle 安装?

最佳答案

其中一个依赖项 json gem 似乎有问题。按照您的编号:

  1. 当您看到段错误时,它通常涉及不匹配的 gemset 或针对错误版本的 ruby​​ 编译的 gem native 扩展,因此您应该朝那个方向看。

    事实上,第一行报告 gem 是从一个 ruby​​ 2.0.0p247 gemset 中获取的,而第二行报告 ruby​​ 1.9.3p194 作为当前解释器。

  2. 在您的特定情况下,我会cd 进入项目文件夹,使用gem pristine --all 重建gemset,使用 重建项目依赖项>bundle update 然后尝试使用项目 binstub 重新运行命令:./bin/rake rspec

  3. 对我来说这似乎不是错误,但你应该时刻注意你使用的 ruby​​ 版本。使用 RVM,您可以指定默认的广泛系统 ruby​​ 版本和 gemset,但也可以根据需要指定任意数量的项目特定 ruby​​ 版本和 gemset,但这有时会导致麻烦。

希望对您有所帮助。

关于ruby-on-rails - 中止(核心转储)ruby 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24248229/

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