2018年5月1日 星期二
rails 5.2 credentials capistrano deploy 的各種坑
Deploy 一直遇到 Error:
```
ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `rails credentials:edit`
```
試了好多方式,理論上設個環境變數就行,但我一直失敗,中途還嘗試把credentials disable 也是沒用,後來是直接上傳 master.key 解決
用這行指令上傳
```
scp config/master.key apps@DOMAIN:PROJECT_NAME/shared/config
```
然後 capistrano link 過去
```
set :linked_files, fetch(:linked_files, []).push("config/database.yml", "config/master.key"
```
http://guides.rubyonrails.org/security.html#custom-credentials
https://keithpblog.org/post/encrypted-secrets/
https://github.com/rails/rails/issues/32413
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言