conf/environment.rbにsession keyの設定をしてない
現在の安定版最新ver0.9.4のenvironment.rbに、Rails2.xのrails自動生成されるonfig.action_controller.session={}が記述されてないみたい。以下のエラーが出ていた。tailしてたら長い長いエラーメッセージに埋もれてしばらく気づかなかった。
- The backend application (process 13999) did not send a valid HTTP response; instead, it sent nothing at all. It is possible that it has crashed; please check whether there are crashing bugs in this application.
- * Exception ArgumentError in application (A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb) (process 13999):
Web屋の人の日記 || WebJourney 開発ログさんの記事を参考に解決。
config/environment.rb
- Rails::Initializer.run do |config|
- :
- characters = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
- secret = Array.new(48){characters[rand(characters.size)]}.join
- config.action_controller.session = {
- :session_key => "_webjourney_session",
- :secret => secret
- }
- :
- end
Phusion Passengerを使ってる場合Apacheをreloadしてspown serverに構成を再読み込みさせる必要があります。
No route matches "/index.html"
Phusion Passenger を使ってるため以下のエラーに遭遇した。devillikeaangelの日記さんの記事を参考に修正。(まんまコピーですいません)
- ActionController::RoutingError (No route matches "/index.html" with {:method=>:get}):
- Rendering /var/rails/redmine/public/404.html (404 Not Found)
どうもmod_rewriteを有効にしてると、index.htmlを探しに行ってしまうみたい。
以下、対処法の抜粋。
passengerで動かすので、Rewriteはいらない。redmine/public/.htaccessにある以下の3行をコメントアウトする
- #RewriteRule ^$ index.html [QSA]
- #RewriteRule ^([^.]+)$ $1.html [QSA]
- #RewriteCond %{REQUEST_FILENAME} !-f
.