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

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

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

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 6

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

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Q&A

0回答

959閲覧

Herokuへのデプロイ時に「ActiveSupport::MessageEncryptor::InvalidMessage」が生じる

kooooop

総合スコア0

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails 6

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

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

0グッド

0クリップ

投稿2020/05/11 07:45

編集2022/01/12 10:55

バージョン情報

バージョン情報

ruby -v ruby 2.5.7p206 (2019-10-01 revision 67816) [x86_64-darwin19] rails -v Rails 6.0.2.2 heroku -v heroku/7.39.6 darwin-x64 node-v12.16.2

実現したいこと

Herokuへのデプロイ。
しかし、Herokuへのデプロイ時に以下のメッセージが発生しました。

発生している問題・エラーメッセージ

git push heroku master -----> ActiveStorage Preview app detected -----> Installing binary dependencies for ActiveStorage Preview Reusing cache Downloading packages.. Installing packages..... -----> Ruby app detected -----> Installing bundler 2.0.2 -----> Removing BUNDLED WITH version in the Gemfile.lock -----> Compiling Ruby/Rails -----> Using Ruby version: ruby-2.5.7 -----> Installing dependencies using bundler 2.0.2 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment ...省略 Bundle complete! 42 Gemfile dependencies, 112 gems now installed. Gems in the groups development and test were not installed. Bundled gems are installed into `./vendor/bundle` Bundle completed (0.66s) Cleaning up the bundler cache. -----> Installing node-v10.15.3-linux-x64 -----> Installing yarn-v1.16.0 -----> Detecting rake tasks -----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:183:in `_decrypt' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb:80:in `decrypt' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb:43:in `read' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:21:in `read' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:33:in `config' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:38:in `options' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb:297:in `method_missing' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/devise-4.7.1/lib/devise/secret_key_finder.rb:24:in `key_exists?' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/devise-4.7.1/lib/devise/secret_key_finder.rb:10:in `find' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/devise-4.7.1/lib/devise/rails.rb:37:in `block in <class:Engine>' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:32:in `instance_exec' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:32:in `run' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:61:in `block in run_initializers' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:60:in `run_initializers' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/railties-6.0.2.2/lib/rails/application.rb:363:in `initialize!' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/config/environment.rb:5:in `<top (required)>' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/railties-6.0.2.2/lib/rails/application.rb:339:in `require_environment!' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/railties-6.0.2.2/lib/rails/application.rb:515:in `block in run_tasks_blocks' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define' /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'` Caused by: OpenSSL::Cipher::CipherError: /tmp/build_4cdbf9d0b2c328a5d1fe29584a02f934/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:201:in `final' ..省略 Tasks: TOP => environment (See full trace by running task with --trace) ! ! Precompiling assets failed. ! ! Push rejected, failed to compile Ruby app. ! Push failed

試したこと

エラー文言より、credentials.yml.encmaster.keyの整合性が取れていないと判断し、以下を実施しました。

  1. credentials.yml.encの中身をコピーの上、credentials.yml.encmaster.keyを削除
  2. sudo credentials.yml.enccredentials.yml.encmaster.keyを再度作成
  3. 1でコピーした内容をcredentials.yml.encに貼り付け
  4. master.keyの内容をheroku config:set RAILS_MASTER_KEY = XXXXXXXXXXでセット
  5. デプロイ

それでも同じエラーが出て、デプロイできませんでした。
なお、ローカル環境ではサーバー起動やcredentialsファイルの編集などは問題なく行えます。

ここが問題では、ということがあればご指摘いただけますと幸いです。
よろしくお願いします。

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問