我在用我用warbler构建的应用程序启动jboss时遇到此错误:
Error: unable to initialize application
org.jruby.rack.RackInitializationException: wrong number of arguments (1 for 0)
调用堆栈:
gems/gems/actionpack-3.0.9/lib/action_controller/railtie.rb:54:in `Railtie'
gems/gems/activesupport-3.0.9/lib/active_support/ordered_hash.rb:139:in `each'
org/jruby/RubyArray.java:1612:in `each'
gems/gems/activesupport-3.0.9/lib/active_support/ordered_hash.rb:139:in `each'
gems/gems/actionpack-3.0.9/lib/action_controller/railtie.rb:54:in `Railtie'
org/jruby/RubyKernel.java:2062:in `instance_eval'
gems/gems/activesupport-3.0.9/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
gems/gems/activesupport-3.0.9/lib/active_support/lazy_load_hooks.rb:43:in `run_load_hooks'
org/jruby/RubyArray.java:1612:in `each'
gems/gems/activesupport-3.0.9/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
gems/gems/actionpack-3.0.9/lib/action_controller/base.rb:232:in `Base'
gems/gems/actionpack-3.0.9/lib/action_controller/base.rb:169:in `ActionController'
gems/gems/actionpack-3.0.9/lib/action_controller/base.rb:3:in `(root)'
gems/gems/actionpack-3.0.9/lib/action_controller/base.rb:48:in `Railtie'
org/jruby/RubyKernel.java:2079:in `instance_exec'
gems/gems/railties-3.0.9/lib/rails/initializable.rb:25:in `run'
gems/gems/railties-3.0.9/lib/rails/initializable.rb:50:in `run_initializers'
org/jruby/RubyArray.java:1612:in `each'
gems/gems/railties-3.0.9/lib/rails/initializable.rb:49:in `run_initializers'
gems/gems/railties-3.0.9/lib/rails/application.rb:134:in `initialize!'
org/jruby/RubyKernel.java:2093:in `send'
gems/gems/railties-3.0.9/lib/rails/application.rb:77:in `method_missing'
config/environment.rb:5:in `(root)'
org/jruby/RubyKernel.java:1038:in `require'
config/environment.rb:167:in `load_environment'
classpath:/./jruby/rack/rails.rb:172:in `to_app'
classpath:/./jruby/rack/rails.rb:192:in `new'
<web.xml>:1:in `(root)'
org/jruby/RubyKernel.java:2062:in `instance_eval'
classpath:/./vendor/rack-1.3.5/rack/builder.rb:51:in `initialize'
<web.xml>:1:in `(root)'
有什么想法吗?
最佳答案
我们在rails 3.0.11/jboss 5和最新的jruby机架上也遇到了同样的问题。
要解决这个问题,我们必须使用jruby rack 1.0.10
请尝试将此行放入您的Gemfile:
gem 'jruby-rack', '1.0.10'
关于ruby-on-rails - 使用JRuby进行 Rack 初始化时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8270213/