生产环境缺少密钥库 [英] Missing secret key base for production environment

查看:34
本文介绍了生产环境缺少密钥库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的情况很像 SemiFixed: Missing `secret_key_base` for生产"环境:

我的配置/secrets.yml

my config/secrets.yml

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

我在/etc/environment 中添加了一个条目,以便在我登录并键入时

I have added an entry in /etc/environment so that when I log in and type

echo $SECRET_KEY_BASE

我得到了用 rake secret 创建的长字符串.但是我仍然收到 500 错误,因为 Missing secret_key_base for 'production' environment,在 config/secrets.yml 中设置这个值,即使我重置了整个计算机.那么还有什么可能出错?

I get the long string I created with rake secret. But still I get 500 error for Missing secret_key_base for 'production' environment, set this value in config/secrets.yml, even after I reset the entire computer. So what else can go wrong?

推荐答案

发现/etc/environment 被 apache2 忽略.将以下内容添加到/etc/apache2/envvars 解决了我的问题:

Found out that /etc/environment is ignored by apache2. Add the following to /etc/apache2/envvars solved my problem:

export SECRET_KEY_BASE=<the long string>

这篇关于生产环境缺少密钥库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆