[英]Reload the secrets.yml doesn't work
I used config/secrets.yml in rails application. 我在rails应用程序中使用了config / secrets.yml 。
I added some api keys. 我添加了一些api密钥。 and then run rails c
, then run the following to get secrets values: 然后运行rails c
,然后运行以下命令获取机密值:
Rails.application.secrets
But I find the old values in secrets.yml
file. 但我在secrets.yml
文件中找到旧值。
Example: 例:
My old values in secrets.yml
was: 我在secrets.yml
中的旧值是:
development:
secret_key_base: 3b7cd727ee24e8444053437c36cc66c3
email_password: 'old@password'
Then I added the following values to be as the following: 然后我添加以下值如下:
development:
secret_key_base: 3b7cd727ee24e8444053437c36cc66c3
email_password: 'old@password'
admin_password: 'admin@password'
Then run Rails.application.secrets
, the output is: 然后运行Rails.application.secrets
,输出为:
{:secret_key_base=>"3b7cd727ee24e8444053437c36cc66c3", :email_password=>"old@password"}
Without the attribute admin_password
. 没有属性admin_password
。
How can I reload the secrets.yml
file to update the secrets value ? 如何重新加载secrets.yml
文件以更新机密值? or How I update rails application configration to load the secrets.yml
file when restart server, and rails console ? 或者我如何更新rails应用程序configration以在重新启动服务器和rails console时加载secrets.yml
文件?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.