バージョン情報
バージョン情報
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.enc
とmaster.key
の整合性が取れていないと判断し、以下を実施しました。
credentials.yml.enc
の中身をコピーの上、credentials.yml.enc
とmaster.key
を削除sudo credentials.yml.enc
でcredentials.yml.enc
とmaster.key
を再度作成- 1でコピーした内容を
credentials.yml.enc
に貼り付け master.key
の内容をheroku config:set RAILS_MASTER_KEY = XXXXXXXXXX
でセット- デプロイ
それでも同じエラーが出て、デプロイできませんでした。
なお、ローカル環境ではサーバー起動やcredentialsファイルの編集などは問題なく行えます。
ここが問題では、ということがあればご指摘いただけますと幸いです。
よろしくお願いします。
あなたの回答
tips
プレビュー