运行rails控制台时,我在开发环境中对Rails.configuration.secret_key_base的调用一直没有返回.
#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
怎么会这样?运行导轨4.1.0
解决方法
如
the documentation所述:
The secrets added to this file are accessible via
Rails.application.secrets
.
从控制台运行Rails.application.secrets.secret_key_base应该返回:-l-secret-secret-by-rake-secret