1

使用 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)'

有任何想法吗?

4

2 回答 2

2

我们在 Rails 3.0.11 / JBoss 5 和最新的 jruby-rack 上遇到了同样的问题。为了解决这个问题,我们不得不使用 jruby-rack 1.0.10

请尝试将此行放入您的 Gemfile:

gem 'jruby-rack', '1.0.10'
于 2011-11-28T00:13:21.713 回答
1

将应用程序升级到 Rails 3 时,我遇到了同样的错误。问题与调用有关ActionController::Base.relative_url_root=,它应该发出弃用警告,但它在 Rails 3.0.10 中被破坏了。

我的解决方案是升级到 jruby-rack 1.1.4 和 rack 1.2.5。

于 2012-03-01T21:41:25.503 回答