Closed raldred closed 9 months ago
When including dotenv require: 'dotenv/load' as per: https://github.com/bkeepers/dotenv?tab=readme-ov-file#load-order
Environment specific .env files such as .env.development are ignored.
.env
.env.development
rails c
Rerun steps with dotenv in Gemfile without require: 'dotenv/load' And the value of the env var is as expected.
require: 'dotenv/load'
Overriding on the shell works as expect TEST_VAR=shell rails c
TEST_VAR=shell rails c
The value of TEST_VAR should be that contained in the .env.development
The value of TEST_VAR is actually that contained in the .env file
dotenv version: 2.8.1 Rails version: 7.1.3 Ruby version: 3.3.0
https://github.com/bkeepers/dotenv/issues/478 😵💫
When including dotenv require: 'dotenv/load' as per: https://github.com/bkeepers/dotenv?tab=readme-ov-file#load-order
Environment specific
.env
files such as.env.development
are ignored.Steps to reproduce
rails c
and observe the value of TEST_VAR.Rerun steps with dotenv in Gemfile without
require: 'dotenv/load'
And the value of the env var is as expected.Overriding on the shell works as expect
TEST_VAR=shell rails c
Expected behavior
The value of TEST_VAR should be that contained in the .env.development
Actual behavior
The value of TEST_VAR is actually that contained in the .env file
System configuration
dotenv version: 2.8.1 Rails version: 7.1.3 Ruby version: 3.3.0