[英]Rails, Missing `secret_key_base` for 'production' on Ubuntu with unicorn and nginx
I'm trying to run my rails app on Ubuntu for the first time using nginx and unicorn. 我正在尝试使用nginx和unicorn首次在Ubuntu上运行Rails应用程序。 My question is, when I look at my log, I see the following error.
我的问题是,当我查看日志时,看到以下错误。
`app error: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml` (
RuntimeError)`
I looked at my secrets.yml
which looks like, 我看了看我的
secrets.yml
,
...
production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
...
When I type echo $SECRET_KEY_BASE
on my command line to check to make sure that the key is set, I get a secret key, which seems to indicate that the key is correctly set. 当我在命令行上键入
echo $SECRET_KEY_BASE
来检查以确保已设置密钥时,我得到了一个秘密密钥,这似乎表明密钥已正确设置。 What is missing here? 这里缺少什么?
Your unicorn process runs as root. 您的独角兽进程以root身份运行。 however you probably set your key with non-root user.
但是,您可能将密钥设置为非root用户。
To fix this problem, I recommend you to use dotenv( https://github.com/bkeepers/dotenv ). 要解决此问题,我建议您使用dotenv( https://github.com/bkeepers/dotenv )。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.