为什么Ruby 1.9.2会因JSON gem依赖性而爆炸?

时间:2010-11-24 01:08:25

标签: ruby-on-rails json ruby-on-rails-3 rubygems ruby-1.9

我遇到了JSON gem和Ruby 1.9.2的问题。我正在升级到Rails 3.0.3,每当我尝试启动环境时,它都会爆炸。这是一个空的测试项目,只有JSON gem 1.4.6作为依赖项。

/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:66: [BUG] unknown type 0x22 (0xc given)
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]

-- control frame ----------
c:0032 p:---- s:0096 b:0096 l:000095 d:000095 CFUNC  :initialize
c:0031 p:---- s:0094 b:0094 l:000093 d:000093 CFUNC  :new
c:0030 p:0085 s:0091 b:0089 l:000088 d:000088 METHOD /Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:66
c:0029 p:0090 s:0081 b:0080 l:000079 d:000079 CLASS  /Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/ext.rb:11
c:0028 p:0011 s:0078 b:0078 l:000077 d:000077 CLASS  /Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/ext.rb:6
c:0027 p:0021 s:0076 b:0076 l:000075 d:000075 TOP    /Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/ext.rb:3
c:0026 p:---- s:0074 b:0074 l:000073 d:000073 FINISH
c:0025 p:---- s:0072 b:0072 l:000071 d:000071 CFUNC  :require
c:0024 p:0027 s:0068 b:0068 l:000067 d:000067 CLASS  /Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json.rb:6
c:0023 p:0021 s:0066 b:0066 l:000065 d:000065 TOP    /Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json.rb:2
c:0022 p:---- s:0064 b:0064 l:000063 d:000063 FINISH
c:0021 p:---- s:0062 b:0062 l:000061 d:000061 CFUNC  :require
c:0020 p:0026 s:0058 b:0058 l:000039 d:000057 BLOCK  /Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:64
c:0019 p:---- s:0055 b:0055 l:000054 d:000054 FINISH
c:0018 p:---- s:0053 b:0053 l:000052 d:000052 CFUNC  :each
c:0017 p:0091 s:0050 b:0050 l:000039 d:000049 BLOCK  /Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:62
c:0016 p:---- s:0045 b:0045 l:000044 d:000044 FINISH
c:0015 p:---- s:0043 b:0043 l:000042 d:000042 CFUNC  :each
c:0014 p:0046 s:0040 b:0040 l:000039 d:000039 METHOD /Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:51
c:0013 p:0021 s:0036 b:0036 l:000035 d:000035 METHOD /Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler.rb:112
c:0012 p:0079 s:0032 b:0032 l:000031 d:000031 TOP    /Users/lee/workspaces/test3/config/application.rb:7
c:0011 p:---- s:0030 b:0030 l:000029 d:000029 FINISH
c:0010 p:---- s:0028 b:0028 l:000027 d:000027 CFUNC  :require
c:0009 p:0016 s:0024 b:0024 l:000015 d:000023 BLOCK  /Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:28
c:0008 p:---- s:0021 b:0021 l:000020 d:000020 FINISH
c:0007 p:---- s:0019 b:0019 l:000018 d:000018 CFUNC  :tap
c:0006 p:0468 s:0016 b:0016 l:000015 d:000015 TOP    /Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :require
c:0003 p:0061 s:0006 b:0006 l:001598 d:000978 EVAL   script/rails:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:001598 d:001598 TOP  
---------------------------
-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `<main>'
script/rails:6:in `require'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:28:in `block in <top (required)>'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:28:in `require'
/Users/lee/workspaces/test3/config/application.rb:7:in `<top (required)>'
/Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
/Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
/Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
/Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `block in require'
/Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
/Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `block (2 levels) in require'
/Users/lee/.rvm/gems/ruby-1.9.2-p0@global/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json.rb:2:in `<top (required)>'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json.rb:6:in `<module:JSON>'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json.rb:6:in `require'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/ext.rb:3:in `<top (required)>'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/ext.rb:6:in `<module:JSON>'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/ext.rb:11:in `<module:Ext>'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:66:in `generator='
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:66:in `new'
/Users/lee/.rvm/gems/ruby-1.9.2-p0/gems/json-1.4.6/lib/json/common.rb:66:in `initialize'

-- C level backtrace information -------------------------------------------
0   libruby.1.9.1.dylib                 0x000000010017f9e2 rb_vm_bugreport + 210
1   libruby.1.9.1.dylib                 0x0000000100039d24 report_bug + 372
2   libruby.1.9.1.dylib                 0x0000000100039ee8 rb_bug + 200
3   libruby.1.9.1.dylib                 0x000000010003b986 rb_check_type + 166
4   generator.bundle                    0x00000001005f5f3a cState_initialize + 42
5   libruby.1.9.1.dylib                 0x00000001001715a9 vm_call0 + 601
6   libruby.1.9.1.dylib                 0x0000000100177a0e rb_funcall2 + 350
7   libruby.1.9.1.dylib                 0x000000010008f743 rb_class_new_instance + 51
8   libruby.1.9.1.dylib                 0x0000000100165497 vm_call_method + 983
9   libruby.1.9.1.dylib                 0x0000000100168225 vm_exec_core + 8293
10  libruby.1.9.1.dylib                 0x000000010016fe63 vm_exec + 1507
11  libruby.1.9.1.dylib                 0x00000001001702ea rb_iseq_eval + 346
12  libruby.1.9.1.dylib                 0x0000000100041e9c rb_load_internal + 300
13  libruby.1.9.1.dylib                 0x00000001000431dc rb_require_safe + 1052
14  libruby.1.9.1.dylib                 0x0000000100165497 vm_call_method + 983
15  libruby.1.9.1.dylib                 0x0000000100168225 vm_exec_core + 8293
16  libruby.1.9.1.dylib                 0x000000010016fe63 vm_exec + 1507
17  libruby.1.9.1.dylib                 0x00000001001702ea rb_iseq_eval + 346
18  libruby.1.9.1.dylib                 0x0000000100041e9c rb_load_internal + 300
19  libruby.1.9.1.dylib                 0x00000001000431dc rb_require_safe + 1052
20  libruby.1.9.1.dylib                 0x0000000100165497 vm_call_method + 983
21  libruby.1.9.1.dylib                 0x0000000100168225 vm_exec_core + 8293
22  libruby.1.9.1.dylib                 0x000000010016fe63 vm_exec + 1507
23  libruby.1.9.1.dylib                 0x000000010017e531 rb_yield + 625
24  libruby.1.9.1.dylib                 0x0000000100009572 rb_ary_each + 82
25  libruby.1.9.1.dylib                 0x0000000100165497 vm_call_method + 983
26  libruby.1.9.1.dylib                 0x0000000100168225 vm_exec_core + 8293
27  libruby.1.9.1.dylib                 0x000000010016fe63 vm_exec + 1507
28  libruby.1.9.1.dylib                 0x000000010017e531 rb_yield + 625
29  libruby.1.9.1.dylib                 0x0000000100009572 rb_ary_each + 82
30  libruby.1.9.1.dylib                 0x0000000100165497 vm_call_method + 983
31  libruby.1.9.1.dylib                 0x0000000100168225 vm_exec_core + 8293
32  libruby.1.9.1.dylib                 0x000000010016fe63 vm_exec + 1507
33  libruby.1.9.1.dylib                 0x00000001001702ea rb_iseq_eval + 346
34  libruby.1.9.1.dylib                 0x0000000100041e9c rb_load_internal + 300
35  libruby.1.9.1.dylib                 0x00000001000431dc rb_require_safe + 1052
36  libruby.1.9.1.dylib                 0x0000000100165497 vm_call_method + 983
37  libruby.1.9.1.dylib                 0x0000000100168225 vm_exec_core + 8293
38  libruby.1.9.1.dylib                 0x000000010016fe63 vm_exec + 1507
39  libruby.1.9.1.dylib                 0x000000010017e531 rb_yield + 625
40  libruby.1.9.1.dylib                 0x000000010008dec1 rb_obj_tap + 17
41  libruby.1.9.1.dylib                 0x0000000100165497 vm_call_method + 983
42  libruby.1.9.1.dylib                 0x0000000100168225 vm_exec_core + 8293
43  libruby.1.9.1.dylib                 0x000000010016fe63 vm_exec + 1507
44  libruby.1.9.1.dylib                 0x00000001001702ea rb_iseq_eval + 346
45  libruby.1.9.1.dylib                 0x0000000100041e9c rb_load_internal + 300
46  libruby.1.9.1.dylib                 0x00000001000431dc rb_require_safe + 1052
47  libruby.1.9.1.dylib                 0x0000000100165497 vm_call_method + 983
48  libruby.1.9.1.dylib                 0x0000000100168225 vm_exec_core + 8293
49  libruby.1.9.1.dylib                 0x000000010016fe63 vm_exec + 1507
50  libruby.1.9.1.dylib                 0x0000000100170168 rb_iseq_eval_main + 504
51  libruby.1.9.1.dylib                 0x000000010003f0f2 ruby_exec_internal + 178
52  libruby.1.9.1.dylib                 0x0000000100041a7c ruby_run_node + 60
53  ruby                                0x0000000100000ecf main + 79
54  ruby                                0x0000000100000e74 start + 52
55  ???                                 0x0000000000000003 0x0 + 3

[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

Abort trap

1 个答案:

答案 0 :(得分:41)

升级到Snow Leopard之后我遇到了一些奇怪的问题,因为它有64位差异,所以如果你升级到Snow Leopard,你可能会遇到同样的问题。

我安装了最新的XCode,然后使用rvm uninstall 1.9.2吹走了我的1.9.2安装,并使用gem update --system; gem pristine --all重建了所有宝石。