带有master.key的Rails 5.2-Heroku部署 [英] Rails 5.2 with master.key - Heroku deployment

查看:102
本文介绍了带有master.key的Rails 5.2-Heroku部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Rails 5.2通过使用很棒的credentials.yml引入了加密机密功能.但是我正在努力使其与Heroku一起使用.

Rails 5.2 introduces the encrypted secrets feature through the usage of the awesome credentials.yml. But I'm struggling to get it to work with Heroku.

现在是否有可用的策略可将Rails 5.2应用程序部署到Heroku?

Is there any Strategy available right now to deploy a Rails 5.2 App to Heroku?

推荐答案

您应该在heroku Web仪表板上或使用控制台设置环境变量RAILS_MASTER_KEY:

You should set the environment variable RAILS_MASTER_KEY, either on your heroku web dashboard, or using console:

$ heroku config:set RAILS_MASTER_KEY=<your-master-key>

示例:

$ heroku config:set RAILS_MASTER_KEY=123456789

(<>是占位符)

Rails会检测到此变量并将其用作您的主键(而不是在 master.key 文件中查找).

Rails will detect this variable and use it as your master key (instead of looking for it in master.key file).

这篇关于带有master.key的Rails 5.2-Heroku部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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