I took over a ROR app and I have changed ENV vars in local_env.yml
and in .env to point to a new MongoDB server on MongoDB Atlas and away from MLab.However, the app is still hitting the db on MLab.
So I also did the following:
bash_profile
, which I have changed. ~/.bash_profile
Is there a way to find out where the app is pulling the ENV variables from?
There is nothing specific in ruby to find out where environment variables are set because they are ENVIRONMENT VARIABLES so first understand what that means.
You could try to grep recursive
grep -rnw 'base/path/to/search/' -e 'MONGO'
There may be other ways to hunt them down depending on what shell you use. But if they are loaded from a file that is not loaded by the shell, but by your ruby app i.e. a yaml file , these may not help you. For more info see this answer