Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 875
cpliu338 Avatar asked Aug 21 '14 15:08

cpliu338


1 Answers

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>
like image 127
cpliu338 Avatar answered Oct 21 '22 11:10

cpliu338