6
votes

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?

1

1 Answers

8
votes

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>