[前][次][番号順一覧][スレッド一覧]

rails:241

From: Stoyan Zhekov <stoyan@g...>
Date: Mon, 4 Jul 2005 15:48:13 +0900
Subject: [rails:241] Re: RAILS_ENV=production

> Railsプロジェクトを production モードにセットするにはどうすればよいので
> しょうか?

== Howto Set Environment Dynamically Based On Path ==
[ http://wiki.rubyonrails.com/rails/show/HowtoSetEnvironmentDynamicallyBasedOnPath
]

1. Apache

---[ /config/environment.rb: ]---

def getEnvironment
  fullpath = File.expand_path(__FILE__,RAILS_ROOT)
  if fullpath =~ /\/dev\// then 'development'
  elsif fullpath =~ /\/test\// then 'test'
  elsif fullpath =~ /\/prod\// then 'production'
  else 'development'
  end
end

#RAILS_ENV  = ENV['RAILS_ENV'] || 'development'
RAILS_ENV = getEnvironment

2. Lighttpd

fastcgi.server =( ".fcgi" =>
  ( "localhost" =>
  (   "socket" => "/tmp/rails.socket",
  "bin-path" => "/path/to/webapp/public/dispatch.fcgi",
  "bin-environment" => ( "RAILS_ENV" => "production" ) ) ) )

--
ML: rails@r...
使い方: http://QuickML.com/

[前][次][番号順一覧][スレッド一覧]

       239 2005-07-04 06:31 [ggb03124@n...       ] RAILS_ENV=production                    
->     241 2005-07-04 08:48 ┗[stoyan@g...         ]