0
When executing the deploy I have the following error: Rack app error: #<RuntimeError: Missing 'secret_token' and 'secret_key_bas' for 'production' environment, set these values in 'config/secrets.yml
I’ve made the necessary settings but I can’t find the problem.
I have the set :linked_files, ["#{shared_path}/config/secrets.yml"]
in my config/deploy.rb
.
I’m using the plugin capistrano-secrets-yml
to put my Secrets.yml in the right place:
l shared/config/secrets.yml
lrwxrwxrwx 1 myuser myiser 63 Aug 4 10:44 shared/config/secrets.yml -> /home/myuser/apps/myapp/shared/config/secrets.yml
And I also exported the secret from in my .bashrc
-> export SECRET_KEY_BASE=MY_SECRET
And *Secrets.yml` uses this variable:
production:
secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
What could be wrong?
Already checked if the <%= ENV['SECRET_KEY_BASE'] %> is returning null?
– Danilo Pádua
I opened on console on my server
rails c
and while typingENV['SECRET_KEY_BASE']
is returning the secret correctly. No configuration missing in the pistrano where he’s not getting this variable?– Daniel
I found the problem, the
<%= ENV['SECRET_KEY_BASE'] %>
in the Secrets.yml doesn’t work if I put the hash in hand works correctly, but how to take the environment variables.– Daniel
I almost said that kkkkk, good, I took one of my doubts too
– Danilo Pádua