I'm creating a new application in Rails 6, and the workflow for keeping secrets in our other Rails apps (anywhere from 4.x and 5.2) was to create an .env
file and import them through the dotenv
gem, and then have config/secrets
pull from the ENV
hash.
However, when I run a console session in the R6 app and I try to access ENV
, I see an old version where the variables I just added do not appear, while other variables I added last week are there. What's stranger is that if I run rails c -e test
, ENV
does include the new variables even though .env.test
does not include them. (Meanwhile, ENV
has all the variables when running through RSpec.)
Does anyone have ideas about this behavior? Should we consider using credentials
instead?
EDIT: Well this is embarrassing: I rebooted my Macbook and now the ENV variables are updated.