発生したエラー
remote: Running: rake assets:precompile remote: rake aborted! remote: ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage remote: /tmp/build_abc824e5/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/message_encryptor.rb:203:in `rescue in _decrypt' ... remote: remote: Caused by: remote: OpenSSL::Cipher::CipherError: remote: /tmp/build_abc824e5/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.3.2/lib/active_support/message_encryptor.rb:198:in `final'
https://docs.ruby-lang.org/ja/latest/class/OpenSSL=3a=3aCipher=3a=3aCipherError.html から、鍵関係のエラーということがわかったので、
EDITOR=vim rails credentials:show
を実行すると
ctiveSupport::MessageEncryptor::InvalidMessageが発生。
https://github.com/rails/rails/issues/31397
から、以下の対処を実行。
対処
master.keyとcredentials.yml.encを作成しなおして、
heroku config:set RAILS_MASTER_KEY=`cat config/master.key`
でセットし直した。