我使用ruby 1.8.7有一段美好的时光,而且自从发布此版本的rails以来,我使用了这个版本的ruby和rails 3.0.x.我从来没有遇到过分段错误。但是现在,在开始使用rails 3.1.3开发ruby 1.8.7之后,当我执行webrick并且我浏览应用程序时,我有以下错误:
/usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/utils.rb:380: [BUG] Segmentation fault
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]
错误是非常不稳定的,有时会发生在webrick的httputils上,有时会发生在机架上。 也许错误与资产管道线有一些关系,因为错误发生在某些过程之前:
Started GET "/assets/wymeditor/wymeditor/lang/zh_cn.js?body=1" for 127.0.0.1 at Wed Dec 28 09:22:23 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/zh_cn.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/zh_cn.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/plugins/embed/jquery.wymeditor.embed.js?body=1" for 127.0.0.1 at Wed Dec 28 09:22:23 -0200 2011
任何人都可以帮我解决这个问题。从现在开始,我感谢您的帮助。
由于
开发日志:
Started GET "/assets/wymeditor/wymeditor/lang/he.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/he.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/he.js - 304 Not Modified (0ms)
Started GET "/assets/wymeditor/wymeditor/lang/hr.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/hr.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/hr.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/hu.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/hu.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/hu.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/it.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/it.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/it.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/nb.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/nb.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/nb.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/nl.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/nl.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/nl.js - 304 Not Modified (4ms)
Started GET "/assets/wymeditor/wymeditor/lang/pl.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/pl.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/pl.js - 304 Not Modified (0ms)
Started GET "/assets/wymeditor/wymeditor/lang/pt-br.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/pt-br.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/pt-br.js - 304 Not Modified (3ms)
Started GET "/assets/wymeditor/wymeditor/lang/pt.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
cache: [GET /assets/wymeditor/wymeditor/lang/pt.js?body=1] stale, valid, store
Served asset /wymeditor/wymeditor/lang/pt.js - 304 Not Modified (1ms)
Started GET "/assets/wymeditor/wymeditor/lang/ru.js?body=1" for 127.0.0.1 at Wed Dec 28 11:57:36 -0200 2011
/usr/lib/ruby/gems/1.8/gems/rack-cache-1.1/lib/rack/cache/metastore.rb:232: [BUG] Segmentation fault
ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-linux]
Abortado
Abortado in English is Aborted
我所有宝石的清单:
Ruby版本: ruby 1.8.7(2010-06-23 patchlevel 299) 拱: [i686的Linux的]
我得到的唯一堆栈跟踪:
/usr/lib/ruby/1.8/webrick/httpserver.rb:50
while timeout > 0
(rdb:2) n
[2011-12-28 16:22:52] ERROR #<Class:0xb6614868>: execution expired
/usr/lib/ruby/1.8/timeout.rb:64:in `timeout'
/usr/lib/ruby/1.8/timeout.rb:101:in `timeout'
/usr/lib/ruby/1.8/webrick/httprequest.rb:326:in `_read_data'
/usr/lib/ruby/1.8/webrick/httprequest.rb:337:in `read_line'
/usr/lib/ruby/1.8/webrick/httprequest.rb:240:in `read_header'
/usr/lib/ruby/1.8/webrick/httprequest.rb:88:in `parse'
/usr/lib/ruby/1.8/webrick/httpserver.rb:56:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/handler/webrick.rb:13:in `run'
/usr/lib/ruby/gems/1.8/gems/rack-1.3.5/lib/rack/server.rb:265:in `start'
/usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands/server.rb:70:in `start'
/usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:54
/usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:49:in `tap'
/usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:49
script/rails:6:in `require'
script/rails:6
/usr/lib/ruby/1.8/webrick/httpserver.rb:51
break if IO.select([sock], nil, nil, 0.5)
在调试模式下,逐行轻松地发生错误。我确实只有一个堆栈跟踪,而且我没有超过一次。
此时我禁用了资产管道,coffeescript和sass。我没有得到更多错误,但我没有更多这些功能。
答案 0 :(得分:0)
来自guides.rubyonrails.org的说明:
请注意,Ruby 1.8.7 p248和p249具有导致Rails 3.0崩溃的编组错误。 Ruby Enterprise Edition自1.8.7-2010.02版本开始就已经修复了。在1.9版本中,Ruby 1.9.1不可用,因为它在Rails 3.0上完全是段错误,所以如果你想使用1..9开启的Rails 3和1.9.2的顺畅航行。
我在1.9.2上运气很好,而且rvm可以很容易地在多个版本的ruby之间切换。你能尝试一下吗?