Top / Redmine / コンテキストパスを指定して起動する

Redmineを「/redmine」などのコンテキストパスを指定して運用するときのメモです。

RedmineをMongrelで起動したときに

mongrel_rails start -e production -p 3000 --prefix=/redmine

ってprefixを指定すると http://xxxxxx/redmine/ などコンテキストパスを指定して起動することができるらしいのですが、

[root@www rails-demo]#  mongrel_rails start -e production -p 3000 --prefix=/redmine
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with production environment...
** Mounting Rails at /redmine...
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:440:in
 `load_missing_constant': uninitialized constant ActionController::AbstractRequest (NameError)

というエラーがでちゃうっぽい。どうも下記のおまじないが必要みたいです。

おまじないは、config/initializers ディレクトリに abstract_request.rb という以下の内容のファイルを作るだけです

module ActionController
  class AbstractRequest < ActionController::Request
    def self.relative_url_root=(path)
      ActionController::Base.relative_url_root=(path)
    end
    def self.relative_url_root
      ActionController::Base.relative_url_root
    end
  end
end

あとは普通に起動すればOKのようです。

関連リンク


この記事は

選択肢 投票
おもしろかった 0  
そうでもない 0  

Top / Redmine / コンテキストパスを指定して起動する

現在のアクセス:5068


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-07-30 (金) 02:08:56 (5017d)