本文介绍了Rails 6 Heroku Devise错误ActiveSupport :: MessageEncryptor :: InvalidMessage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Rails 6应用程序部署到Heroku,这是我第一次在Rails 6 bit中从heroku获取以下输出:

i'm trying to deploy my Rails 6 app to Heroku, this is the first time I do in Rails 6 bit I'm getting this output from heroku:

remote: Compressing source files... done.
remote: Building source:
remote:
remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote:             Detected buildpacks: Ruby,Node.js
remote:             See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.0.2
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.7.1
remote: -----> Installing dependencies using bundler 2.0.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        [DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set deployment 'true'`, and stop using this flag
remote:        [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path 'vendor/bundle'`, and stop using this flag
remote:        [DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'development:test'`, and stop using this flag
remote:        [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs`
remote:        The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
remote:        Fetching gem metadata from https://rubygems.org/............
remote:        Fetching rake 13.0.1
remote:        Installing rake 13.0.1
remote:        Fetching concurrent-ruby 1.1.6
remote:        Fetching minitest 5.14.0
remote:        Fetching thread_safe 0.3.6
remote:        Installing minitest 5.14.0
remote:        Installing thread_safe 0.3.6
remote:        Fetching zeitwerk 2.3.0
remote:        Installing concurrent-ruby 1.1.6
remote:        Installing zeitwerk 2.3.0
remote:        Fetching builder 3.2.4
remote:        Fetching erubi 1.9.0
remote:        Installing builder 3.2.4
remote:        Installing erubi 1.9.0
remote:        Fetching mini_portile2 2.4.0
remote:        Fetching crass 1.0.6
remote:        Installing mini_portile2 2.4.0
remote:        Installing crass 1.0.6
remote:        Fetching rack 2.2.2
remote:        Fetching nio4r 2.5.2
remote:        Fetching websocket-extensions 0.1.4
remote:        Installing nio4r 2.5.2 with native extensions
remote:        Installing websocket-extensions 0.1.4
remote:        Installing rack 2.2.2
remote:        Fetching mimemagic 0.3.4
remote:        Installing mimemagic 0.3.4
remote:        Fetching mini_mime 1.0.2
remote:        Installing mini_mime 1.0.2
remote:        Fetching public_suffix 4.0.4
remote:        Fetching bcrypt 3.1.13
remote:        Installing public_suffix 4.0.4
remote:        Installing bcrypt 3.1.13 with native extensions
remote:        Fetching msgpack 1.3.3
remote:        Installing msgpack 1.3.3 with native extensions
remote:        Using bundler 2.1.4
remote:        Fetching orm_adapter 0.5.0
remote:        Installing orm_adapter 0.5.0
remote:        Fetching method_source 1.0.0
remote:        Installing method_source 1.0.0
remote:        Fetching thor 1.0.1
remote:        Installing thor 1.0.1
remote:        Fetching devise-bootstrap-views 1.1.0
remote:        Installing devise-bootstrap-views 1.1.0
remote:        Fetching erubis 2.7.0
remote:        Installing erubis 2.7.0
remote:        Fetching ffi 1.12.2
remote:        Installing ffi 1.12.2 with native extensions
remote:        Fetching temple 0.8.2
remote:        Installing temple 0.8.2
remote:        Fetching tilt 2.0.10
remote:        Installing tilt 2.0.10
remote:        Fetching sexp_processor 4.14.1
remote:        Installing sexp_processor 4.14.1
remote:        Fetching htmlentities 4.3.4
remote:        Installing htmlentities 4.3.4
remote:        Fetching mini_magick 4.10.1
remote:        Installing mini_magick 4.10.1
remote:        Fetching pg 1.2.3
remote:        Installing pg 1.2.3 with native extensions
remote:        Fetching redis 4.1.3
remote:        Installing redis 4.1.3
remote:        Fetching turbolinks-source 5.2.0
remote:        Installing turbolinks-source 5.2.0
remote:        Fetching tzinfo 1.2.7
remote:        Installing tzinfo 1.2.7
remote:        Fetching i18n 1.8.2
remote:        Installing i18n 1.8.2
remote:        Fetching nokogiri 1.10.9
remote:        Installing nokogiri 1.10.9 with native extensions
remote:        Fetching websocket-driver 0.7.1
remote:        Installing websocket-driver 0.7.1 with native extensions
remote:        Fetching rack-test 1.1.0
remote:        Installing rack-test 1.1.0
remote:        Fetching warden 1.2.8
remote:        Installing warden 1.2.8
remote:        Fetching rack-proxy 0.6.5
remote:        Installing rack-proxy 0.6.5
remote:        Fetching sprockets 4.0.0
remote:        Installing sprockets 4.0.0
remote:        Fetching mail 2.7.1
remote:        Installing mail 2.7.1
remote:        Fetching marcel 0.3.3
remote:        Installing marcel 0.3.3
remote:        Fetching addressable 2.7.0
remote:        Installing addressable 2.7.0
remote:        Fetching puma 4.3.3
remote:        Installing puma 4.3.3 with native extensions
remote:        Fetching haml 5.1.2
remote:        Installing haml 5.1.2
remote:        Fetching ruby_parser 3.14.2
remote:        Installing ruby_parser 3.14.2
remote:        Fetching bootsnap 1.4.6
remote:        Installing bootsnap 1.4.6 with native extensions
remote:        Fetching turbolinks 5.2.1
remote:        Installing turbolinks 5.2.1
remote:        Fetching activesupport 6.0.2.2
remote:        Installing activesupport 6.0.2.2
remote:        Fetching ruby-vips 2.0.17
remote:        Installing ruby-vips 2.0.17
remote:        Fetching sassc 2.2.1
remote:        Installing sassc 2.2.1 with native extensions
remote:        Fetching css_parser 1.7.1
remote:        Installing css_parser 1.7.1
remote:        Fetching loofah 2.5.0
remote:        Installing loofah 2.5.0
remote:        Fetching html2haml 2.2.0
remote:        Installing html2haml 2.2.0
remote:        Fetching rails-dom-testing 2.0.3
remote:        Installing rails-dom-testing 2.0.3
remote:        Fetching globalid 0.4.2
remote:        Installing globalid 0.4.2
remote:        Fetching activemodel 6.0.2.2
remote:        Installing activemodel 6.0.2.2
remote:        Fetching jbuilder 2.10.0
remote:        Installing jbuilder 2.10.0
remote:        Fetching image_processing 1.10.3
remote:        Installing image_processing 1.10.3
remote:        Fetching premailer 1.11.1
remote:        Installing premailer 1.11.1
remote:        Fetching rails-html-sanitizer 1.3.0
remote:        Installing rails-html-sanitizer 1.3.0
remote:        Fetching activejob 6.0.2.2
remote:        Installing activejob 6.0.2.2
remote:        Fetching activerecord 6.0.2.2
remote:        Fetching actionview 6.0.2.2
remote:        Installing activerecord 6.0.2.2
remote:        Installing actionview 6.0.2.2
remote:        Fetching actionpack 6.0.2.2
remote:        Installing actionpack 6.0.2.2
remote:        Fetching actioncable 6.0.2.2
remote:        Fetching activestorage 6.0.2.2
remote:        Installing actioncable 6.0.2.2
remote:        Installing activestorage 6.0.2.2
remote:        Fetching actionmailer 6.0.2.2
remote:        Installing actionmailer 6.0.2.2
remote:        Fetching railties 6.0.2.2
remote:        Fetching sprockets-rails 3.2.1
remote:        Installing sprockets-rails 3.2.1
remote:        Installing railties 6.0.2.2
remote:        Fetching actionmailbox 6.0.2.2
remote:        Installing actionmailbox 6.0.2.2
remote:        Fetching actiontext 6.0.2.2
remote:        Installing actiontext 6.0.2.2
remote:        Fetching premailer-rails 1.11.1
remote:        Installing premailer-rails 1.11.1
remote:        Fetching responders 3.0.0
remote:        Fetching haml-rails 2.0.1
remote:        Installing responders 3.0.0
remote:        Installing haml-rails 2.0.1
remote:        Fetching rails 6.0.2.2
remote:        Installing rails 6.0.2.2
remote:        Fetching webpacker 4.2.2
remote:        Fetching devise 4.7.1
remote:        Installing webpacker 4.2.2
remote:        Installing devise 4.7.1
remote:        Fetching devise-i18n 1.9.1
remote:        Installing devise-i18n 1.9.1
remote:        Fetching devise_invitable 2.0.1
remote:        Installing devise_invitable 2.0.1
remote:        Fetching sassc-rails 2.1.2
remote:        Installing sassc-rails 2.1.2
remote:        Fetching sass-rails 6.0.0
remote:        Installing sass-rails 6.0.0
remote:        Bundle complete! 35 Gemfile dependencies, 82 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into `./vendor/bundle`
remote:        Post-install message from i18n:
remote:
remote:        HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
remote:        But that may break your application.
remote:
remote:        If you are upgrading your Rails application from an older version of Rails:
remote:
remote:        Please check your Rails app for 'config.i18n.fallbacks = true'.
remote:        If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
remote:        'config.i18n.fallbacks = [I18n.default_locale]'.
remote:        If not, fallbacks will be broken in your app by I18n 1.1.x.
remote:
remote:        If you are starting a NEW Rails application, you can ignore this notice.
remote:
remote:        For more info see:
remote:        https://github.com/svenfuchs/i18n/releases/tag/v1.1.0
remote:
remote:        Removing bundler (2.0.2)
remote:        Bundle completed (178.50s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing node-v10.15.3-linux-x64
remote: -----> Installing yarn-v1.16.0
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:183:in `_decrypt'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb:80:in `decrypt'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb:43:in `read'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:21:in `read'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:33:in `config'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:38:in `options'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb:297:in `method_missing'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/devise-4.7.1/lib/devise/secret_key_finder.rb:24:in `key_exists?'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/devise-4.7.1/lib/devise/secret_key_finder.rb:10:in `find'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/devise-4.7.1/lib/devise/rails.rb:37:in `block in <class:Engine>'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:32:in `instance_exec'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:32:in `run'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:60:in `run_initializers'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/application.rb:363:in `initialize!'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/config/environment.rb:7:in `<main>'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/application.rb:339:in `require_environment!'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/application.rb:515:in `block in run_tasks_blocks'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
remote:
remote:        Caused by:
remote:        OpenSSL::Cipher::CipherError:
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:201:in `final'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:201:in `_decrypt'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb:80:in `decrypt'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_file.rb:43:in `read'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:21:in `read'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:33:in `config'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/encrypted_configuration.rb:38:in `options'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/core_ext/module/delegation.rb:297:in `method_missing'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/devise-4.7.1/lib/devise/secret_key_finder.rb:24:in `key_exists?'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/devise-4.7.1/lib/devise/secret_key_finder.rb:10:in `find'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/devise-4.7.1/lib/devise/rails.rb:37:in `block in <class:Engine>'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:32:in `instance_exec'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:32:in `run'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:61:in `block in run_initializers'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/initializable.rb:60:in `run_initializers'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/application.rb:363:in `initialize!'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/config/environment.rb:7:in `<main>'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.4.6/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.3.0/lib/zeitwerk/kernel.rb:23:in `require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `block in require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:291:in `load_dependency'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.2.2/lib/active_support/dependencies.rb:325:in `require'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/application.rb:339:in `require_environment!'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/railties-6.0.2.2/lib/rails/application.rb:515:in `block in run_tasks_blocks'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
remote:        /tmp/build_08cbdbc00910a90e852ff158e1b74e8f/vendor/bundle/ruby/2.7.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
remote:        Tasks: TOP => environment
remote:        (See full trace by running task with --trace)
remote:
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to hagotarea-dev.
remote:

我已经尝试过在一些存储库和网站中找到的许多解决方案:

I already tried many of the solutions I found in some repos and websites:

  • 删除 config/master.key config/encrypted.credentials.yml 并重新添加 EDITOR ="vim" bin/rails凭证:edit
  • RAILS_MASTER_KEY 添加到Heroku应用程序的配置变量中.
  • 也将 SECRET_KEY_BASE 添加到Heroku.
  • 重新生成主密钥后重新运行 rails g devise:install .
  • Deleting config/master.key and config/encrypted.credentials.yml and rebuiding with EDITOR="vim" bin/rails credentials:edit
  • Add RAILS_MASTER_KEY to the Heroku app's config vars.
  • Add SECRET_KEY_BASE to Heroku too.
  • Re-running rails g devise:install after regenerating master key.

什么都不起作用,所有东西都提供相同的输出.

Nothing works, everything gives the same output.

这是我的 Gemfile

# frozen_string_literal: true

source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "2.7.1"

gem "bcrypt", "~> 3.1.7"
gem "bootsnap", ">= 1.4.2", require: false
gem "devise"
gem "devise-bootstrap-views", "~> 1.0"
gem "devise-i18n"
gem "devise_invitable", "~> 2.0.0"
gem "haml-rails", "~> 2.0"
gem "image_processing", "~> 1.2"
gem "jbuilder", "~> 2.7"
gem "pg", ">= 0.18", "< 2.0"
gem "premailer-rails"
gem "puma", "~> 4.1"
gem "rails", "~> 6.0.2"
gem "redis", "~> 4.0"
gem "sass-rails", ">= 6"
gem "turbolinks", "~> 5"
gem "webpacker", "~> 4.0"

group :development, :test do
  gem "annotate"
  gem "awesome_print"
  gem "byebug", platforms: %i[mri mingw x64_mingw]
  gem "rubocop", require: false
  gem "rubocop-performance", require: false
  gem "rubocop-rails_config", require: false
end

group :development do
  gem "brakeman"
  gem "listen", ">= 3.0.5", "< 3.2"
  gem "spring"
  gem "spring-watcher-listen", "~> 2.0.0"
  gem "web-console", ">= 3.3.0"
end

group :test do
  gem "capybara", ">= 2.15"
  gem "faker"
  gem "selenium-webdriver"
  gem "simplecov", require: false
  gem "webdrivers"
  gem "rails-controller-testing"
end

gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]

谢谢!

推荐答案

我可能在这里迟到了,但是在使用Rails 6和凭据时要记住这一点:

I might be late here but keep this in mind when working with Rails 6 and credentials:

1-每当您编辑Rails凭证(例如: rails凭证:edit-环境生产)时,rails都会生成一个新密钥(config/credentials/production.key),并允许您添加自己的密钥.文件中的凭据.

1- Whenever you edit rails credentials(eg: rails credentials:edit --environment production), rails generates a new key(config/credentials/production.key) and also lets you add your credentials in a file.

2-在 production.rb 文件中,取消注释 config.require_master_key = true ,然后使用以下命令在服务器中设置ENV( RAILS_MASTER_KEY )config/credentials/production.key中提到的密钥(例如: heroku config:set RAILS_MASTER_KEY = XXXXXXXXX ).

2- In production.rb file, uncomment config.require_master_key = true and set an ENV(RAILS_MASTER_KEY) in your server with the key mentioned in config/credentials/production.key(eg: heroku config:set RAILS_MASTER_KEY=XXXXXXXXX).

3-切勿与任何人共享production.key文件,也不要将其推送到VC​​,也不要尝试更改它,因为如果删除/更改此文件,所有凭据可能会丢失.

3- Never share production.key file with anyone nor push it to VC and dont attempt to change it because all of the credentials might get lost if this file gets delete/changed.

这篇关于Rails 6 Heroku Devise错误ActiveSupport :: MessageEncryptor :: InvalidMessage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 16:40