Last Updated: January 29, 2019
·
3.577K
· acechase

Make environment variables available during asset compilation on heroku

If you're trying to use the Heroku approach to putting as much config into the ENV as possible then you may run into problems with their assets:precompile step, which does not have access to the ENV. This makes it really tough to do things like have separate staging and production servers with different embedded URLs in the CSS.

Beta feature to the rescue!
https://devcenter.heroku.com/articles/labs-user-env-compile

heroku labs:enable userenvcompile -a <app-name>

Now your ENV will be available during asset compilation.

1 Response
Add your response

I'll try this...

over 1 year ago ·