質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.46%
Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

1626閲覧

[rails on rails]master.keyを消してしまった

TaikiNamioka

総合スコア24

Ruby on Rails 6

Ruby on Rails 6は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2021/09/16 09:55

ror6でmaster.keyを紛失しました。
credentials.yml.encmaster.key.encは存在しています。
両方を削除し、sudo EDITOR="vi" rails credentials:editを実行したところ、
以下のようなエラーが出てしましました。

この場合master.keyはどのように再作成すればよろしいでしょうか?

17: from bin/rails:4:in `<main>' 16: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.3.1/lib/active_support/dependencies.rb:332:in `require' 15: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.3.1/lib/active_support/dependencies.rb:299:in `load_dependency' 14: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.3.1/lib/active_support/dependencies.rb:332:in `block in require' 13: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 12: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 11: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 10: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 9: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.4.8/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 8: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/railties-6.1.3.1/lib/rails/commands.rb:18:in `<main>' 7: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/railties-6.1.3.1/lib/rails/command.rb:50:in `invoke' 6: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/railties-6.1.3.1/lib/rails/command/base.rb:69:in `perform' 5: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch' 4: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command' 3: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run' 2: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/railties-6.1.3.1/lib/rails/commands/credentials/credentials_command.rb:33:in `edit' 1: from /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.3.1/lib/active_support/encrypted_file.rb:49:in `key' /{ローカルでのパス}/vendor/bundle/ruby/2.6.0/gems/activesupport-6.1.3.1/lib/active_support/encrypted_file.rb:110:in `handle_missing_key': Missing encryption key to decrypt file with. Ask your team for your master key and write it to /{ローカルでのパス}/config/master.key or put it in the ENV['RAILS_MASTER_KEY']. (ActiveSupport::EncryptedFile::MissingKeyError)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

aws内の環境変数からmaster.keyを取得して解決しました

投稿2021/10/11 16:42

TaikiNamioka

総合スコア24

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.46%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問