你如何用Ruby on Rails 4.1.0beta1管理密钥和heroku? [英] How do you manage secret keys and heroku with Ruby on Rails 4.1.0beta1?

查看:114
本文介绍了你如何用Ruby on Rails 4.1.0beta1管理密钥和heroku?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着secrets.yml文件的发布,我删除了对Figaro的依赖,并将所有密钥移至secrets.yml并将该文件添加到.gitignore。



<但是,当我尝试推向Heroku时,Heroku表示他们需要该文件在我的回购站中以部署该网站。这是有道理的,但我不希望我的钥匙在git中,如果我可以避免它。



使用Figaro,我将运行rake任务以将密钥部署到heroku作为env变量并在.gitignore中保留application.yml。显然,我不能再这样做了。那么我该如何处理这个问题? 解决方案

查看这个链接的heroku设置



如果你想像这样在本地使用



KEY = xyz OTHER_KEY = 123 rails s


With the release of the secrets.yml file, I removed my reliance on Figaro and moved all of my keys to secrets.yml and added that file to .gitignore.

But when I tried to push to Heroku, Heroku said they needed that file in my repo in order to deploy the website. which makes sense, but I don't want my keys in git if I can avoid it.

With Figaro, I would run a rake task to deploy the keys to heroku as env variables and keep application.yml in the .gitignore. Obviously, I can't do that any more. So how do I handle this?

解决方案

see this link for heroku settings

if u want to run on local use like this

KEY=xyz OTHER_KEY=123 rails s

这篇关于你如何用Ruby on Rails 4.1.0beta1管理密钥和heroku?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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