我花了最近三天试图将一个jruby / rails / couchdb应用程序部署到linux / tomcat环境中。我已准备好拍摄一些东西了。我目前的问题是这个 - 有一个特定的gem,“simply_stored”,作为couchdb的顶级驱动程序。每当我点击触摸这个宝石的应用程序中的代码时,我就会得到这个红宝石的痕迹:
IOError in HomeController#index
closed stream
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/simply_stored-0.3.6/lib/simply_stored.rb:7
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/simply_stored-0.3.6/lib/simply_stored.rb:31:in 'require'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in 'require'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in 'new_constants_in'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:156:in 'require'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/simply_stored-0.3.6/lib/simply_stored/couch.rb:5
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/simply_stored-0.3.6/lib/simply_stored/couch.rb:380:in 'load'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:380:in 'load_file'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in 'new_constants_in'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:379:in 'load_file'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:259:in 'require_or_load'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:425:in 'load_missing_constant'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in 'const_missing_with_dependencies'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/app/models/job.rb:2
/var/lib/tomcat6/webapps/ROOT/WEB-INF/app/models/job.rb:380:in 'load'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:380:in 'load_file'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:521:in 'new_constants_in'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:379:in 'load_file'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:259:in 'require_or_load'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:425:in 'load_missing_constant'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:80:in 'const_missing_with_dependencies'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:92:in 'const_missing'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:437:in 'load_missing_constant'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:96:in 'const_missing'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/app/controllers/home_controller.rb:3:in 'index'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:1331:in 'perform_action'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:617:in 'call_filters'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:610:in 'perform_action_with_filters'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in 'perform_action_with_benchmark'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in 'ms'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in 'ms'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in 'perform_action_with_benchmark'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/rescue.rb:160:in 'perform_action_with_rescue'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/flash.rb:151:in 'perform_action_with_flash'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in 'process'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/filters.rb:606:in 'process_with_filters'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:391:in 'process'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/base.rb:386:in 'call'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:438:in 'call'
框架跟踪:
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-stdlib-1.5.2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in 'require'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-stdlib-1.5.2.jar!/META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:308:in 'realtime'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:87:in 'dispatch'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:121:in '_call'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:130:in 'build_middleware_stack'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/head.rb:9:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/methodoverride.rb:24:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/lock.rb:11:in 'call'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:114:in 'call'
/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:108:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:36:in 'serve_rails'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/adapter/rails.rb:41:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:180:in 'call'
file:/var/lib/tomcat6/webapps/ROOT/WEB-INF/lib/jruby-rack-1.0.3.jar!/rack/handler/servlet.rb:19:in 'call'
现在,我最初的反应是它与与couchdb的通信有关。这仍然是可能的,尽管不太可能。指定不存在的地址具有相同的效果。这个库适用于很多人(包括我自己,在我的开发环境中 - os x / WEBRick)。深入挖掘,我发现了一些(相当分散的)类似问题的参考,具有不同的功能。这是一个:what could be causing this rails ioerror closed stream?
有趣的是,在active_support首次加载/处理文件后,这两个错误似乎都在短时间内发生。这个流问题可能与加载ruby文件有关,而不是tcp连接的东西?
我在这里完全不知所措,我们将非常感谢任何帮助。
编辑 :有趣的新花絮 - 如果使用glassfish而不是tomcat,这个问题会在相同的配置上消失。相同的服务器,相同的战争文件。