前提・実現したいこと
VPS(本番環境)にRails6をデプロイ後、DB作成コマンド(rails db:create RAILS_ENV=production
)を実行すると、master.key周りのエラーが発生してしまいます。
master.keyがロードされてない様子で、いくつか方法を試してみても、変わりませんでした。
ご教授いただけると助かります。
発生している問題・エラーメッセージ
Missing encryption key to decrypt file with. Ask your team for your master key and write it to /var/www/test_blog/config/credentials/production.key or put it in the ENV['RAILS_MASTER_KEY'].
試したこと
- 開発環境のmaster.keyの中身をコピペする
本番のconfig配下にtouch master.key
コマンドでmaster.keyを作り、コピペ。
- 以下のファイルに設定を追記する
config/enviroments/production.rb
ruby
1config.require_master_key = true
config/deploy.rb
set :linked_files, %w{config/master.key}
補足情報(FW/ツールのバージョンなど)
Rails 6.0.3.7
MySQL 8.0.25
ubuntu 0.20.04

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。