cpliu338
cpliu338

Reputation: 647

Missing secret key base for production environment

My situation is very much like SemiFixed: Missing `secret_key_base` for 'production' environment :

my config/secrets.yml

production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

I have added an entry in /etc/environment so that when I log in and type

echo $SECRET_KEY_BASE

I get the long string I created with rake secret. But still I get 500 error for Missing secret_key_base for 'production' environment, set this value in config/secrets.yml, even after I reset the entire computer. So what else can go wrong?

Upvotes: 6

Views: 4857

Answers (1)

cpliu338
cpliu338

Reputation: 647

Found out that /etc/environment is ignored by apache2. Add the following to /etc/apache2/envvars solved my problem:

export SECRET_KEY_BASE=<the long string>

Upvotes: 8

Related Questions