I am developing a Rails 4 app on cloud9 (c9.io). When I placed SECRET="geheim"
in config file, it works fine. I tried setting an environment variable using
echo "export SECRET=geheim" >> ~/.profile
and then using ENV['SECRET']
in config file, but it doesn't work. When I type printenv SECRET
in console, it returns nothing, meaning the variable is not set. How can I fix this? Thanks.
In the linux terminal:
For example, setting an AWS-S3 bucket:
source: https://docs.aws.amazon.com/cloud9/latest/user-guide/env-vars.html
The above solution has the problem that the variables are cleared when the Cloud9 EC2 is rebooted. To persist the variable you must add the
export
statement to the~/.bashrc
. You could use vim for edit: