Warbler によって生成された war ファイルを使用して、Rails アプリを Tomcat にデプロイしようとしています。war ファイルは問題なく /myproject-rails-gui にデプロイされますが、アプリのページにアクセスしようとすると、次のようになります。
ArgumentError: wrong number of arguments (1 for 0)
send at org/jruby/RubyKernel.java:2097
Railtie at /home/myproject/apache-tomcat-7.0.22/webapps/myproject-rails-gui/WEB-INF/gems/gems/actionpack-3.0.10/lib/action_controller/railtie.rb:54
relative_url_root を設定しようとすると失敗します。relative_url_root は非推奨であり、代わりに RAILS_RELATIVE_URL_ROOT 環境変数を設定する必要があることを (正しく) 指摘している他の Stack Overflow 記事があります。
module ActionController
class Base
# Deprecated methods. Wrap them in a module so they can be overwritten by plugins
# (like the verify method.)
module DeprecatedBehavior #:nodoc:
def relative_url_root
ActiveSupport::Deprecation.warn "ActionController::Base.relative_url_root is ineffective. " <<
"Please stop using it.", caller
end
def relative_url_root=
ActiveSupport::Deprecation.warn "ActionController::Base.relative_url_root= is ineffective. " <<
"Please stop using it.", caller
end
ただし、Warbler と Tomcat を使用してそれを行う方法を理解することはできませんでした。助言がありますか?価値があるのは、アプリをルート コンテキストで実行すると正常に動作することです。
私の環境:
- ウグイス 1.3.2
- トムキャット 7.0.22
- JRuby 1.6.5
- レール 3.0.10