lundi 29 août 2016

Best place to check for env variables in Rails

I use ENV variables for all environments to set up different components of the stack, i.e. Redis, Memcached, etc.

I load all of these in the config/application.rb file, and before that I ensure that all environment variables are present.

I'm running into a problem now where I run a rake task before these variables are set, and so it fails my test. Rake seems to doing it's share correctly. This leads me to believe all of these variables initializations are in the wrong spot.

Now I'm at a loss as to the best place to instantiate all these services or check for their existence.

Aucun commentaire:

Enregistrer un commentaire