I have already read this question : Rails.env vs RAILS_ENV
I have added rails-dev-boost plugin (http://github.com/thedarkone/rails-dev-boost) and it internally uses Rails.env.development? to check and bypass its scripts if its not development. This is generally okay.
But I also use Spork Testunit (http://github.com/timcharper/spork-testunit/)to fire up a test server to quickly run tests. But this causes problem and loads up rails-dev-boost while running the tests. I checked within the rails-dev-boost plugin's init.rb and it says :
Rails.env.development? # = true
RAILS_ENV # = "test"
Why are these values different? Is there any other things that are settings these values different? Any ideas?
In the documentation:
def env
@_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development")
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With