在Engine Yard上设置环境变量

Jor*_*cía 5 deployment production ruby-on-rails engineyard

我的应用程序是在Engine Yard服务上,我需要设置环境变量以使用我的秘密ID和密码.

有人知道如何设置每个变量?做这个的最好方式是什么?

Vla*_*gel 12

我刚刚设法为在Unicorn上运行的应用程序设置环境变量.

  1. 打开/data/ {app_name} /shared/config/env.custom并将其编辑为如下所示:

    export SECRET_ID=yourid
    export SECRET_PASSWORD=yourpass
    
    Run Code Online (Sandbox Code Playgroud)
  2. 重启独角兽 /engineyard/bin/app_{app_name} reload

如果您正在使用乘客,请查看:
https://stackoverflow.com/a/12955526/1520775
https://github.com/jimneath/ey-cloud-recipes/tree/master/cookbooks/passenger_env_vars