On a regular rails application, that requires dotenv/load, env is loaded twice: once at dotenv/load time and once at rails initialization.
% cat test.rb
require 'rails'
require 'dotenv/load'
require_relative 'config/environment'
% bundle exec ruby test.rb
[dotenv] Loaded .env.development.local
[dotenv] Loaded .env.development
[dotenv] Loaded .env.development.local
[dotenv] Loaded .env.development
I believe this is because the rails initializer is inconditional:
|
config.before_configuration { load } |
On a regular rails application, that requires
dotenv/load, env is loaded twice: once at dotenv/load time and once at rails initialization.I believe this is because the rails initializer is inconditional:
dotenv/lib/dotenv/rails.rb
Line 107 in 34156bf