Rails 3.1服务器启动失败,“中止陷阱:6”

时间:2011-10-03 23:25:29

标签: ruby-on-rails ruby ruby-on-rails-3

当我尝试在我的Rails 3.1应用程序上执行rails s时,我得到了:

/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/rack-1.3.4/lib/rack/backports/uri/common_192.rb:53: warning: already initialized constant WFKV_
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/eventmachine-0.12.10/lib/rubyeventmachine.bundle: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0]

-- control frame ----------
c:0038 p:-17557387368028 s:0124 b:0124 l:000123 d:000123 TOP   
c:0037 p:---- s:0122 b:0122 l:000121 d:000121 CFUNC  :require
c:0036 p:0012 s:0118 b:0118 l:000102 d:000117 BLOCK  /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240
c:0035 p:0005 s:0116 b:0116 l:000107 d:000115 BLOCK  /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223
c:0034 p:0045 s:0114 b:0114 l:000113 d:000113 METHOD /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640
c:0033 p:0041 s:0108 b:0108 l:000107 d:000107 METHOD /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223
c:0032 p:0019 s:0103 b:0103 l:000102 d:000102 METHOD /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240
c:0031 p:0150 s:0097 b:0097 l:000096 d:000096 TOP    /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/eventmachine-0.12.10/lib/eventmachine.rb:66
c:0030 p:---- s:0095 b:0095 l:000094 d:000094 FINISH
c:0029 p:---- s:0093 b:0093 l:000092 d:000092 CFUNC  :require
c:0028 p:0012 s:0089 b:0089 l:000073 d:000088 BLOCK  /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240
c:0027 p:0005 s:0087 b:0087 l:000078 d:000086 BLOCK  /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223
c:0026 p:0045 s:0085 b:0085 l:000084 d:000084 METHOD /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640
c:0025 p:0041 s:0079 b:0079 l:000078 d:000078 METHOD /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223
c:0024 p:0019 s:0074 b:0074 l:000073 d:000073 METHOD /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240
c:0023 p:0083 s:0068 b:0068 l:000067 d:000067 TOP    /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/thin-1.2.11/lib/thin.rb:7
c:0022 p:---- s:0065 b:0065 l:000064 d:000064 FINISH
c:0021 p:---- s:0063 b:0063 l:000062 d:000062 CFUNC  :require
c:0020 p:0026 s:0059 b:0059 l:000040 d:000058 BLOCK  /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:68
c:0019 p:---- s:0056 b:0056 l:000055 d:000055 FINISH
c:0018 p:---- s:0054 b:0054 l:000053 d:000053 CFUNC  :each
c:0017 p:0091 s:0051 b:0051 l:000040 d:000050 BLOCK  /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:66
c:0016 p:---- s:0046 b:0046 l:000045 d:000045 FINISH
c:0015 p:---- s:0044 b:0044 l:000043 d:000043 CFUNC  :each
c:0014 p:0046 s:0041 b:0041 l:000040 d:000040 METHOD /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:55
c:0013 p:0021 s:0037 b:0037 l:000036 d:000036 METHOD /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler.rb:122
c:0012 p:0089 s:0033 b:0033 l:000032 d:000032 TOP    /Users/Kyle/Desktop/skateparks-web/config/application.rb:7
c:0011 p:---- s:0031 b:0031 l:000030 d:000030 FINISH
c:0010 p:---- s:0029 b:0029 l:000028 d:000028 CFUNC  :require
c:0009 p:0016 s:0025 b:0025 l:000016 d:000024 BLOCK  /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.1.0/lib/rails/commands.rb:52
c:0008 p:---- s:0022 b:0022 l:000021 d:000021 FINISH
c:0007 p:---- s:0020 b:0020 l:000019 d:000019 CFUNC  :tap
c:0006 p:0721 s:0017 b:0017 l:000016 d:000016 TOP    /Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.1.0/lib/rails/commands.rb:49
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:0000f8 d:000678 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:0000f8 d:0000f8 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `<main>'
script/rails:6:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.1.0/lib/rails/commands.rb:49:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.1.0/lib/rails/commands.rb:52:in `block in <top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/railties-3.1.0/lib/rails/commands.rb:52:in `require'
/Users/Kyle/Desktop/skateparks-web/config/application.rb:7:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/thin-1.2.11/lib/thin.rb:7:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/eventmachine-0.12.10/lib/eventmachine.rb:66:in `<top (required)>'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
/Users/Kyle/.rvm/gems/ruby-1.9.2-p290@skateparks/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'

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

[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: 6

5 个答案:

答案 0 :(得分:7)

您似乎正在使用依赖于 EventMachine 网络服务器作为其网络IO。

EventMachine包含本机代码,它是在安装gem时为您的机器架构编译的。如果在机器之间移动宝石或更新或恢复操作系统,则可能需要重新编译本机位。

由于您使用的是 rvm gemset ,因此有一个简单的命令可以重新编译当前gemset中的所有gem:

rvm gemset pristine

或所有宝石集:

rvm all-gemsets do rvm gemset pristine

答案 1 :(得分:1)

rvm use ruby-1.9.3-p448

为我修好了。即使选择了默认值,也可以指定您正在使用的内容。

答案 2 :(得分:0)

尽量减少问题。注释掉一些代码。删除一些宝石。最终你会确切地确定哪一块失败了。

如果所有其他方法都失败了,请在http://www.ruby-lang.org/bugreport.html

报告为红​​宝石错误

答案 3 :(得分:0)

brew install -f imagemagick --disable-openmp

答案 4 :(得分:0)

我在更新操作系统时遇到过这个问题。你最近升级到Mountain Lion之类的吗?如果您使用的是Mac,请确保已安装xCode命令行工具。