Rails.env vs RAILS_ENV

前端 未结 5 1020
难免孤独
难免孤独 2020-11-30 17:38

I see both in examples when checking what env one is running in. What\'s preferred? Are they, for all intents and purposes equal?

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 18:40

    ENV['RAILS_ENV'] is now deprecated.

    You should use Rails.env which is clearly much nicer.

提交回复
热议问题