问题描述
我的应用程序在Engine Yard服务上,我需要设置环境变量以使用我的机密ID和密码。
My app is on Engine Yard services and I need to set the environment variables to work with my secret id and password.
有人知道如何设置每个变量?最好的方法是什么?
Somebody know how I can set each variables? What is the best way to do this?
推荐答案
我刚刚设法为在Unicorn上运行的应用程序设置了环境变量。
I've just managed to set environment variables for my application running on Unicorn.
-
打开/data/{app_name}/shared/config/env.custom并对其进行编辑,如下所示:
Open /data/{app_name}/shared/config/env.custom and edit it to look like this:
export SECRET_ID=yourid
export SECRET_PASSWORD=yourpass
重新启动独角兽 / engineyard / bin / app_ {app_name}重新加载
如果您使用的是乘客,请查看:
If you are using passenger take a look at:
https://stackoverflow.com/a/12955526/1520775
https://github.com/jimneath/ey-cloud-recipes/tree/master/cookbooks/passenger_env_vars
这篇关于在引擎码上设置环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!