technical notes about web, languages, graphics or other software development stuff. Railsではデフォルトでdevelopment, test, productionという環境に対応できるように作られているのはご存知の通り。 この環境ごとの設定や、新しい環境の追加方法などについて、簡単にまとめる。 ちなみに執筆時点では以下の実行環境を利用している。 Ruby: 1.9.2 Ruby on Rails: 3.0.5 環境名を取得する Rubyのコードの中から現在の環境名(development|test|productionなど)を取得するのは、Rails.envを利用する。 新しい環境設定を追加する 例えばstagingという環境を新規に追加するには、以下の作業をする。 RAILS_HOME/config