Rails4 中 因为secret key 引起在production环境下无法运行
2015-07-15 16:02
183 查看
错误信息
因为rails 4 出于安全考虑,需要在production 的情况下 ,生成一个key,通过 web_app/config/secrets.yml 读取。
由于安全方面的考虑,此key值不建议放入git发布。
解决方法
1.在服务器上 rake secret RAILS_ENV=production 生成key
2.在shell中 export 到环境变量中
Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`
因为rails 4 出于安全考虑,需要在production 的情况下 ,生成一个key,通过 web_app/config/secrets.yml 读取。
production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
由于安全方面的考虑,此key值不建议放入git发布。
解决方法
1.在服务器上 rake secret RAILS_ENV=production 生成key
[root@iZ25ka6ra32Z weixin_post]# rake secret RAILS_ENV=production 77cc6867b69965249198ded31d6c346d97c1abf029c
2.在shell中 export 到环境变量中
[root@iZ25ka6ra32Z weixin_post]# export SECRET_KEY_BASE=77cc6867b69965249198ded31d6c346d97
相关文章推荐
- toj3852. Haitang1
- push-pull和open drain
- [Win32SDK基本]ListView Controls(2)Report (details) View 详解(续)
- container_of的使用
- DDD(Domain Driver Designer) 领域驱动设计简介
- Scala之Trait的使用
- poj 1273 Drainage Ditches(最大流)
- CONTAINING_RECORD IN EFI
- RapidMiner studio之MainFrame源码分析
- Windows Mobile Emulator:Failed to open the VPC Network Driver.
- HDU 2686 Matrix 3376 Matrix Again(费用流)
- Microsoft.AlphaImageLoader滤镜讲--透明处理<转>
- HTTP Error 503. The service is unavailable
- Software caused connection abort: recv failed
- INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING
- Determining IP information for eth0... failed; no link present. Check cable?
- storm on yarn安装时 提交到yarn失败 failed
- storm on yarn安装时 提交到yarn失败 failed
- 配置OpenStack的glance出现错误Failed to show index. Got error: You are not authenticated.
- Grails最佳实践