Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ruby on rails: heroku: Missing `secret_key_base` for 'production' environment

I added the key into heroku config var, but I'm still getting the error.

Is this the correct way? I ignored secrets.yml as I read from other sources that its not a good idea to push this to the public.

in the heroku config var:

[key] SECRET_KEY_BASE
[value] 3280570382948240938

in secrets.yml

production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

What am I still doing wrong?

Furthermore, if I put my secret keys into heroku's config variable, don't other developers get to see this too? So, isn't that still kind of public? I've always wondered this concept.

like image 692
hellomello Avatar asked Jul 03 '16 07:07

hellomello


1 Answers

you can set environment variable with heroku config

first generate secret key with run below command on terminal

rake secret

Now use that key on below command

heroku config:set SECRET_KEY_BASE='put here new generated key'

you can refer this link for more refference

https://devcenter.heroku.com/articles/config-vars

like image 182
Hardik Upadhyay Avatar answered Sep 25 '22 14:09

Hardik Upadhyay