Kind of pulling my hair out here. Other than hard coding the secret_key_base into secrets.yml, I cannot figure out a way to get it into my Rails 4.1 app running on Ubuntu 14 and deployed via the Rubber gem using unicorn and nginx.
I have tried the following
in secrets.yml
:
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
and in my /etc/environment
:
export SECRET_KEY_BASE=ivegotalovelybunchofcoconuts
That gives me:
app error: Missing secret_token and secret_key_base for 'production' environment, set these values in config/secrets.yml
I tried the figaro gem and put this into my application.rb
config.secret_key_base = Figaro.env.SECRET_KEY_BASE
Same error.
If I launch a console I can see the variables no problem:
irb(main):004:0> Rails.application.secrets.secret_key_base
=> "ivegotalovelybunchofcoconuts"
irb(main):005:0> Figaro.env.SECRET_KEY_BASE
=> "ivegotalovelybunchofcoconuts"