Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails configuration secret key base returning nil

When running rails console, my call to Rails.configuration.secret_key_base in my development environment keeps returning nil.

#secrets.yml

development:
  secret_key_base: the-long-secret-generated-by-rake-secret

#...other configs, a call while running heroku rails c in production also returns nil

How can this be? Running rails 4.1.0

like image 522
computer_smile Avatar asked Nov 03 '14 19:11

computer_smile


1 Answers

As noted in the documentation:

The secrets added to this file are accessible via Rails.application.secrets.

Running Rails.application.secrets.secret_key_base from the console should return: the-long-secret-generated-by-rake-secret

like image 156
Lukas Eklund Avatar answered Oct 11 '22 14:10

Lukas Eklund