dotenv icon indicating copy to clipboard operation
dotenv copied to clipboard

Dotenv.load/overload defaults to only .env

Open mpchlets opened this issue 11 years ago • 3 comments

It seems that Dotenv.load and Dotenv.overload defaults to using just .env - I would expect it to use the same: .env -> .env.#{Rails.env} -> .env.local defaults

See these line

 def self.with(*filenames, &block)
    filenames << '.env' if filenames.empty?

I would want this to include .env.local and .env.#{Rails.env} - I know I can pass it, but I assume that is the default anyhow. I don't mind making the Pull Request if that is the desired behavior for the gem

mpchlets avatar Apr 29 '15 06:04 mpchlets

Both .load and .overload only ready from .env by default. Here is the Rails integration that loads multiple files. If you need anything more than that, I would just recommend using dotenv and not dotenv-rails and loading things manually.

bkeepers avatar Apr 29 '15 13:04 bkeepers

Sorry, here' is the rails integration: https://github.com/bkeepers/dotenv/blob/master/lib/dotenv/rails.rb#L27-L31

bkeepers avatar Apr 29 '15 13:04 bkeepers

How about just a mention of this in the README, it is very confusing.

mpchlets avatar Apr 29 '15 16:04 mpchlets