Comments (3)
Looking into this further, it appears that I'm only getting the behavior I'm expecting in the Rails console, the workers and the web app are both incorrectly loading this, and after looking at the code it seems that this might not be expected behavior at all (it appears that the environment specific file is loaded before the .env file).
In light of this, my question is... is dotenv capable of setting defaults in the .env file and then overriding them in environment specific files, or do you simply go with either a single .env file or environment specific .env files?
from dotenv.
This issue is described in #45. Right now there is not a workaround for it. Once #95 ships, the dotenv-deployment
gem should fix it by actually overriding local variables with the environment-specific version.
from dotenv.
Yeah, I saw #45 and this didn't feel quite the same, but I think that I was using dotenv in a way that it was not designed to work. Thanks.
from dotenv.
Related Issues (20)
- [dotenv-rails] .env.local should be loaded in test environments HOT 20
- Spring::MissingApplication HOT 1
- [would be great if] dotenv supported "source" from other envs HOT 1
- `Dotenv::Railtie.overload` violates policy about `env` files priority HOT 3
- Refresh ENV during runtime HOT 2
- Only subset of shell functionality is supported HOT 2
- Ask somthing in docs HOT 1
- Could not find dotenv-2.7.6 in any of the sources HOT 1
- Just HOT 1
- Special characters are being escaped from the value of the environment variables HOT 3
- dotenv-rails loads dev environment when running system tests with Rails 7 HOT 5
- `Dotenv.load` call causes Rails app to be loaded twice HOT 2
- Not specifying required ruby version on Gemfile causes my bundler with ruby 2.5.x pull dotenv 2.8.0 HOT 6
- template is not created in working directory HOT 2
- Question on Removal of ### What other .env* files can I use? FAQ HOT 1
- README should explicitly call out the gem needed is `dotenv-rails` HOT 4
- environment specific env not loaded when using require: 'dotenv/load' HOT 1
- Rails < v6.1: LocalJumpError in tagged logging HOT 2
- autorestore: can't modify frozen Hash HOT 7
- Use existing TaggedLogger instead of re-wrapping it with `TaggedLogging` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotenv.