-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dotenv.load behavior is different from Dotenv.parse #392
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I can look at putting together a PR for this. |
I just stumbled over that problem. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@amanfredi I just see, that README says:
So it seems, that this situation mentioned in this issue in itself is not really a bug, but a big change in behaviour.
I expected |
It does say that, and the parse example
follows the idiom of the Parse was added recently in #362 and the test coverage doesn't actually cover overriding any values (look at the fixtures, their values do not intersect). Needs a PR. I'll try to improve the test as a starting point. |
If you want to script around this in a way that won't break if/when the bug is fixed, you might try something like:
|
Steps to reproduce
Tell us how to reproduce the issue.
Show how you included dotenv (Gemfile).
Expected behavior
MY_ENV_VAR should be 'production' in the return value
The documentation says that the "most important" files should be passed first, and that the first value set will be kept. This is consistent with the order of filenames defined in lib/dotenv/rails.rb
'.env' comes last and we expect that values in later files are only used if they are not already set by a prior file.
Actual behavior
MY_ENV_VAR is 'development'
The actual behavior is the reverse. The last file passed to dotenv has the highest priority.
System configuration
dotenv version: 2.7.2
Rails version: N/A
Ruby version: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
The text was updated successfully, but these errors were encountered: