Rails 问题:在本地运行 Ruby-China,一直不停地报如下错误

diguage · 2015年08月12日 · 最后由 diguage 回复于 2015年08月13日 · 3359 次阅读

最近看完了《Ruby 编程语言》,感觉有点太高屋建瓴,理解的不是很好。接着看了半本《The Well-Grounded Rubyist》,这本由浅入深,感觉非常不错,强推!然后又看完了《Ruby on Rails Tutorial》,也跟着代码敲了一遍,感觉很不错,看来学 Rails 之前还是看看 Ruby 理解地会更透彻。

再然后“野心勃勃”,想看看 RubyChina 的源代码。就在本地搭建起来。把环境依赖解决掉之后就顺利运行了。跑起来妥妥的。但是,观察日志,似乎一直在不停地刷日志。看了看,没发现什么问题,请帮忙看一下。

换了 Unicorn 后,又报错了。

日志如下:

第一次更新:使用 WEBrick,报NotImplementedError错误

Started POST "/message-bus/eb72b7b705dc4bf4915708f49e5c630c/poll" for ::1 at 2015-08-12 16:45:33 +0800

NotImplementedError (only partial hijack is supported.):
  rack (1.6.4) lib/rack/handler/webrick.rb:76:in `block in service'
  message_bus (1.0.9) lib/message_bus/rack/middleware.rb:114:in `call'
  message_bus (1.0.9) lib/message_bus/rack/middleware.rb:114:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  rack (1.6.4) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.6.4) lib/rack/session/abstract/id.rb:220:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
  actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/reloader.rb:73:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  rack (1.6.4) lib/rack/runtime.rb:18:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  actionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  rack-utf8_sanitizer (1.2.2) lib/rack/utf8_sanitizer.rb:15:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  rack-mini-profiler (0.9.3) lib/mini_profiler/profiler.rb:276:in `call'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  railties (4.2.3) lib/rails/engine.rb:518:in `call'
  railties (4.2.3) lib/rails/application.rb:165:in `call'
  railties (4.2.3) lib/rails/railtie.rb:194:in `public_send'
  railties (4.2.3) lib/rails/railtie.rb:194:in `method_missing'
  oneapm_rpm (1.1.3) lib/one_apm/rack/middleware_tracing.rb:63:in `call'
  rack (1.6.4) lib/rack/lock.rb:17:in `call'
  rack (1.6.4) lib/rack/content_length.rb:15:in `call'
  rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
  /Users/diguage/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
  /Users/diguage/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
  /Users/diguage/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'


  Rendered /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_source.erb (2.3ms)
  Rendered /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (0.9ms)
  Rendered /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (1.6ms)
  Rendered /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/actionpack-4.2.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb (83.8ms)

第二次更新:使用 unicorn,报死锁

$ unicorn  -p 3000
I, [2015-08-12T18:20:51.379787 #61952]  INFO -- : listening on addr=0.0.0.0:3000 fd=9
I, [2015-08-12T18:20:51.379889 #61952]  INFO -- : worker=0 spawning...
I, [2015-08-12T18:20:51.381007 #61952]  INFO -- : master process ready
I, [2015-08-12T18:20:51.382163 #61953]  INFO -- : worker=0 spawned pid=61953
I, [2015-08-12T18:20:51.382615 #61953]  INFO -- : Refreshing Gem list
=> Memory usage: 122.69 Mb
I, [2015-08-12T18:20:55.375589 #61953]  INFO -- : worker=0 ready
127.0.0.1 - - [12/Aug/2015:18:20:56 +0800] "POST /message-bus/eb72b7b705dc4bf4915708f49e5c630c/poll?dlp=t HTTP/1.1" 200 - 0.0512
127.0.0.1 - - [12/Aug/2015:18:20:56 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0029
127.0.0.1 - - [12/Aug/2015:18:21:05 +0800] "GET /cpanel HTTP/1.1" 200 5443 0.8361
127.0.0.1 - - [12/Aug/2015:18:21:05 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0057
127.0.0.1 - - [12/Aug/2015:18:21:06 +0800] "GET /cpanel HTTP/1.1" 200 5442 0.0920
127.0.0.1 - - [12/Aug/2015:18:21:07 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0043
127.0.0.1 - - [12/Aug/2015:18:21:09 +0800] "GET / HTTP/1.1" 200 12772 0.1775
127.0.0.1 - - [12/Aug/2015:18:21:09 +0800] "GET /big_logo.png HTTP/1.1" 304 - 0.0365
127.0.0.1 - - [12/Aug/2015:18:21:09 +0800] "GET / HTTP/1.1" 200 12793 0.1314
127.0.0.1 - - [12/Aug/2015:18:21:09 +0800] "GET /front.css HTTP/1.1" 304 - 0.0417
127.0.0.1 - - [12/Aug/2015:18:21:09 +0800] "GET /app.js HTTP/1.1" 304 - 0.0458
127.0.0.1 - - [12/Aug/2015:18:21:09 +0800] "GET /big_logo.png HTTP/1.1" 304 - 0.0351
127.0.0.1 - - [12/Aug/2015:18:21:10 +0800] "GET /RobotoDraftRegular.woff2 HTTP/1.1" 304 - 0.0424
127.0.0.1 - - [12/Aug/2015:18:21:10 +0800] "GET /fontawesome-webfont.woff2?v=4.3.0 HTTP/1.1" 304 - 0.0381
127.0.0.1 - - [12/Aug/2015:18:21:10 +0800] "GET /RobotoDraftBold.woff2 HTTP/1.1" 304 - 0.0742
127.0.0.1 - - [12/Aug/2015:18:21:10 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0057
127.0.0.1 - - [12/Aug/2015:18:21:10 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0046
127.0.0.1 - - [12/Aug/2015:18:21:10 +0800] "POST /message-bus/47ef56e3fed6485ea85eabb38f5ef053/poll HTTP/1.1" 200 - 0.0390
127.0.0.1 - - [12/Aug/2015:18:21:10 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0034
ThreadError: deadlock; recursive locking
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/lock.rb:16:in `lock'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/lock.rb:16:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/actionpack-4.2.3/lib/action_dispatch/middleware/static.rb:116:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-utf8_sanitizer-1.2.2/lib/rack/utf8_sanitizer.rb:15:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-mini-profiler-0.9.3/lib/mini_profiler/profiler.rb:276:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/railties-4.2.3/lib/rails/engine.rb:518:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/railties-4.2.3/lib/rails/application.rb:165:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `public_send'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `method_missing'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/tempfile_reaper.rb:15:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/lint.rb:49:in `_call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/lint.rb:37:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/showexceptions.rb:24:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/sinatra-1.4.5/lib/sinatra/base.rb:217:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/chunked.rb:54:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:580:in `process_client'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:674:in `worker_loop'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:140:in `start'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/bin/unicorn:126:in `<top (required)>'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/bin/unicorn:23:in `load'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/bin/unicorn:23:in `<main>'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/bin/ruby_executable_hooks:15:in `eval'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/bin/ruby_executable_hooks:15:in `<main>'
127.0.0.1 - - [12/Aug/2015:18:21:12 +0800] "GET /topics HTTP/1.1" 500 120229 0.0253
127.0.0.1 - - [12/Aug/2015:18:21:12 +0800] "GET /topics HTTP/1.1" 200 13502 0.1875
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "GET /front.css HTTP/1.1" 304 - 0.0483
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "GET /app.js HTTP/1.1" 304 - 0.0501
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "GET /RobotoDraftRegular.woff2 HTTP/1.1" 304 - 0.0496
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "GET /fontawesome-webfont.woff2?v=4.3.0 HTTP/1.1" 304 - 0.0454
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "GET /RobotoDraftBold.woff2 HTTP/1.1" 304 - 0.0514
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "GET /RobotoDraftMedium.woff2 HTTP/1.1" 304 - 0.0474
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0074
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0033
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "POST /message-bus/944ff539b1f14d788b0796ab9f47aa6e/poll HTTP/1.1" 200 - 0.0400
127.0.0.1 - - [12/Aug/2015:18:21:13 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0032
ThreadError: deadlock; recursive locking
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/lock.rb:16:in `lock'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/lock.rb:16:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/actionpack-4.2.3/lib/action_dispatch/middleware/static.rb:116:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-utf8_sanitizer-1.2.2/lib/rack/utf8_sanitizer.rb:15:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-mini-profiler-0.9.3/lib/mini_profiler/profiler.rb:276:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/railties-4.2.3/lib/rails/engine.rb:518:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/railties-4.2.3/lib/rails/application.rb:165:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `public_send'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/railties-4.2.3/lib/rails/railtie.rb:194:in `method_missing'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/tempfile_reaper.rb:15:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/lint.rb:49:in `_call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/lint.rb:37:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/showexceptions.rb:24:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/commonlogger.rb:33:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/sinatra-1.4.5/lib/sinatra/base.rb:217:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/chunked.rb:54:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/rack-1.6.4/lib/rack/content_length.rb:15:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/oneapm_rpm-1.1.3/lib/one_apm/rack/middleware_tracing.rb:63:in `call'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:580:in `process_client'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:674:in `worker_loop'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:529:in `spawn_missing_workers'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/lib/unicorn/http_server.rb:140:in `start'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/gems/unicorn-4.9.0/bin/unicorn:126:in `<top (required)>'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/bin/unicorn:23:in `load'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/bin/unicorn:23:in `<main>'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/bin/ruby_executable_hooks:15:in `eval'
    /Users/diguage/.rvm/gems/ruby-2.2.2@ruby-china/bin/ruby_executable_hooks:15:in `<main>'
127.0.0.1 - - [12/Aug/2015:18:21:14 +0800] "GET /topics/2 HTTP/1.1" 500 120290 0.0309
127.0.0.1 - - [12/Aug/2015:18:21:14 +0800] "GET /topics/2 HTTP/1.1" 200 16028 0.2545
127.0.0.1 - - [12/Aug/2015:18:21:14 +0800] "GET /front.css HTTP/1.1" 304 - 0.0419
127.0.0.1 - - [12/Aug/2015:18:21:14 +0800] "GET /app.js HTTP/1.1" 304 - 0.0426
127.0.0.1 - - [12/Aug/2015:18:21:14 +0800] "GET /RobotoDraftRegular.woff2 HTTP/1.1" 304 - 0.0372
127.0.0.1 - - [12/Aug/2015:18:21:14 +0800] "GET /fontawesome-webfont.woff2?v=4.3.0 HTTP/1.1" 304 - 0.0364
127.0.0.1 - - [12/Aug/2015:18:21:14 +0800] "GET /RobotoDraftMedium.woff2 HTTP/1.1" 304 - 0.0387
127.0.0.1 - - [12/Aug/2015:18:21:15 +0800] "GET /RobotoDraftBold.woff2 HTTP/1.1" 304 - 0.0382
127.0.0.1 - - [12/Aug/2015:18:21:17 +0800] "GET /topics/2 HTTP/1.1" 200 16049 0.1563
127.0.0.1 - - [12/Aug/2015:18:21:17 +0800] "GET /front.css HTTP/1.1" 304 - 0.0398
127.0.0.1 - - [12/Aug/2015:18:21:17 +0800] "GET /app.js HTTP/1.1" 304 - 0.0390
127.0.0.1 - - [12/Aug/2015:18:21:17 +0800] "GET /RobotoDraftRegular.woff2 HTTP/1.1" 304 - 0.0407
127.0.0.1 - - [12/Aug/2015:18:21:17 +0800] "GET /fontawesome-webfont.woff2?v=4.3.0 HTTP/1.1" 304 - 0.0457
127.0.0.1 - - [12/Aug/2015:18:21:17 +0800] "GET /RobotoDraftMedium.woff2 HTTP/1.1" 304 - 0.0420
127.0.0.1 - - [12/Aug/2015:18:21:17 +0800] "GET /RobotoDraftBold.woff2 HTTP/1.1" 304 - 0.0363
127.0.0.1 - - [12/Aug/2015:18:21:18 +0800] "GET /topics/2 HTTP/1.1" 200 16070 0.1585
127.0.0.1 - - [12/Aug/2015:18:21:18 +0800] "GET /front.css HTTP/1.1" 304 - 0.0403
127.0.0.1 - - [12/Aug/2015:18:21:18 +0800] "GET /app.js HTTP/1.1" 304 - 0.0385
127.0.0.1 - - [12/Aug/2015:18:21:18 +0800] "GET /RobotoDraftRegular.woff2 HTTP/1.1" 304 - 0.0378
127.0.0.1 - - [12/Aug/2015:18:21:18 +0800] "GET /fontawesome-webfont.woff2?v=4.3.0 HTTP/1.1" 304 - 0.0396
127.0.0.1 - - [12/Aug/2015:18:21:18 +0800] "GET /RobotoDraftMedium.woff2 HTTP/1.1" 304 - 0.0384
127.0.0.1 - - [12/Aug/2015:18:21:18 +0800] "GET /RobotoDraftBold.woff2 HTTP/1.1" 304 - 0.0381
127.0.0.1 - - [12/Aug/2015:18:21:19 +0800] "GET / HTTP/1.1" 200 12856 0.1485
127.0.0.1 - - [12/Aug/2015:18:21:19 +0800] "GET /big_logo.png HTTP/1.1" 304 - 0.0471
127.0.0.1 - - [12/Aug/2015:18:21:20 +0800] "GET /topics HTTP/1.1" 200 13589 0.1791
127.0.0.1 - - [12/Aug/2015:18:21:22 +0800] "GET /topics/2 HTTP/1.1" 200 16134 0.2056
127.0.0.1 - - [12/Aug/2015:18:21:22 +0800] "GET /sprites/[email protected] HTTP/1.1" 304 - 0.0411
127.0.0.1 - - [12/Aug/2015:18:21:22 +0800] "GET /RobotoDraftItalic.woff2 HTTP/1.1" 200 13268 0.0411
127.0.0.1 - - [12/Aug/2015:18:21:24 +0800] "GET /mini-profiler-resources/includes.css?v=9db1f8db18400644bd5c7449e5295620 HTTP/1.1" 304 - 0.0019
127.0.0.1 - - [12/Aug/2015:18:21:24 +0800] "GET /mini-profiler-resources/jquery.tmpl.js?v=9db1f8db18400644bd5c7449e5295620 HTTP/1.1" 304 - 0.0014
127.0.0.1 - - [12/Aug/2015:18:21:24 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0058
127.0.0.1 - - [12/Aug/2015:18:21:24 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0025
127.0.0.1 - - [12/Aug/2015:18:21:24 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0044
127.0.0.1 - - [12/Aug/2015:18:21:24 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0045
127.0.0.1 - - [12/Aug/2015:18:21:24 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0052
127.0.0.1 - - [12/Aug/2015:18:21:26 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0060
127.0.0.1 - - [12/Aug/2015:18:21:26 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0037
127.0.0.1 - - [12/Aug/2015:18:21:26 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0031
127.0.0.1 - - [12/Aug/2015:18:21:26 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0034
127.0.0.1 - - [12/Aug/2015:18:21:26 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0017
127.0.0.1 - - [12/Aug/2015:18:21:26 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0025
127.0.0.1 - - [12/Aug/2015:18:21:32 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0070
127.0.0.1 - - [12/Aug/2015:18:21:32 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0038
127.0.0.1 - - [12/Aug/2015:18:21:32 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0039
127.0.0.1 - - [12/Aug/2015:18:21:32 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0034
127.0.0.1 - - [12/Aug/2015:18:21:32 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0017
127.0.0.1 - - [12/Aug/2015:18:21:32 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0028
127.0.0.1 - - [12/Aug/2015:18:21:32 +0800] "POST /mini-profiler-resources/results HTTP/1.1" 200 - 0.0034

因为跑 rails s 的 App Server 不支持

#1 楼 @huacnlee 换了 unicorn,报死锁了。

@diguage

  • 1. MB 使用 socket hijacking API 实现客户端和服务段的轮询和推送,而 webrick 是禁用 hijack 的: webrick.rb
env.update(
  RACK_VERSION      => Rack::VERSION,
  RACK_INPUT        => rack_input,
  RACK_ERRORS       => $stderr,
  RACK_MULTITHREAD  => true,
  RACK_MULTIPROCESS => false,
  RACK_RUNONCE      => false,
  RACK_URL_SCHEME   => ["yes", "on", "1"].include?(env[HTTPS]) ? "https" : "http",
  RACK_IS_HIJACK    => true,
  RACK_HIJACK       => lambda { raise NotImplementedError, "only partial hijack is supported."},
  RACK_HIJACK_IO    => nil
)

#3 楼 @mueven 谢谢。我看咋回事。 Ruby 多线程那块看的不是太明白。看来还得再研究研究。哈哈

需要 登录 后方可回复, 如果你还没有账号请 注册新账号