Some of the environment variables are not loaded
Strangely some of the environment variables on my development machine are not being loaded
Gemfile
group :development, :test do
gem 'dotenv-rails'
end
Gemfile.lock
dotenv (2.2.0)
dotenv-rails (2.2.0)
dotenv (= 2.2.0)
railties (>= 3.2, < 5.1)
Paste your env using:
$ env | grep SUPERFEEDR_USER
$
.env file in Rails root directory
WEBHOOK_TUNNEL_URL="https://chandan.ngrok.io"
SUPERFEEDR_USER="user"
SUPERFEEDR_API_TOKEN='xxxxxxxxxxxxx'
secrets.yml
common: &common
superfeedr_user: <%= ENV["SUPERFEEDR_USER"] %>
superfeedr_api_token: <%= ENV["SUPERFEEDR_API_TOKEN"] %>
local: &local
<<: *common
redis_url: 'redis://localhost:6379'
webhook_tunnel_url: <%= ENV["WEBHOOK_TUNNEL_URL"] %>
development:
<<: *local
secret_key_base: xxxxxxx
Expected behavior
{
:superfeedr_user=>"user",
:superfeedr_api_token=>"xxxxxxxxxxxxx",
:redis_url=>"redis://localhost:6379",
:webhook_tunnel_url=>"https://chandan.ngrok.io",
:secret_key_base=>"xxxxxxx"
}
Actual behavior
- Missing
webhook_tunnel_urlkey superfeedr_userisnil
{
:superfeedr_user=>nil,
:superfeedr_api_token=>"xxxxxxxxxxxxx",
:redis_url=>"redis://localhost:6379",
:secret_key_base=>"xxxxxxx"
}
System configuration
dotenv version: 2.2.0
Rails version: 5.0.1
Ruby version: 2.3.3p222
UPDATE:
After restarting the system, I'm getting expected output. I'm wondering how did it pick up one environment variable and ignore another variable.
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 get this same issue quite often.
happened the same to me, annoying. Could this be related to a specific dotenv loading issue? or maybe related to the underlying OS (MacOS 10.15.7 in my case)?
Update: Tried bin/spring stop as suggested here with no success
!nostale