For Ruby on Rails applications, I've noticed that I don't have the option to do a ENV['NUCLEAR_LAUNCH_CODES'] = 12345 anywhere unlike Heroku.

For a Rails 3.2.17 application, does anyone know what the best practice is?

有帮助吗?

解决方案

You can set environment variables with figaro gem.

其他提示

You can use this recipe from Engine Yard.

If you have some sensitive data in your environment vars, the custom recipe allow you to manage your vars outside your application repos.

Your application can use environment vars configured in the recipe after you apply the recipe.

But if you use rails console via ssh, you have to explicitly read and execute the config file before you enter a console.

source /data/YOUR_APP_NAME/shared/config/env.custom
bundle exec rails console
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top