Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reload the secrets.yml doesn't work

I used config/secrets.yml in rails application.

I added some api keys. and then run rails c, then run the following to get secrets values:

Rails.application.secrets

But I find the old values in secrets.yml file.

Example:

My old values in secrets.yml was:

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:

{:secret_key_base=>"3b7cd727ee24e8444053437c36cc66c3", :email_password=>"old@password"}

Without the attribute admin_password.

How can I reload the secrets.yml file to update the secrets value ? or How I update rails application configration to load the secrets.yml file when restart server, and rails console ?

like image 409
Mohamed Yakout Avatar asked Nov 10 '15 00:11

Mohamed Yakout


1 Answers

I post this answer depend on @FabKremer comment on question.

To solve this issue.I needed to reload the spring server by the following:

bin/spring stop

For more details, read this answer.

like image 163
Mohamed Yakout Avatar answered Oct 13 '22 16:10

Mohamed Yakout