簡體   English   中英

Rails 5.2.0加載應用程序錯誤:ActiveSupport :: MessageEncryptor :: InvalidMessage(ActiveSupport :: MessageEncryptor :: InvalidMessage

[英]Rails 5.2.0 load application error: ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::MessageEncryptor::InvalidMessage

我已經嘗試了解決方案,這些解決方案在以下鏈接中發布:
使用master.key Digital Ocean部署的Rails 5.2:ActiveSupport :: MessageEncryptor :: InvalidMessage:ActiveSupport :: MessageEncryptor :: InvalidMessage Rails部署Digitalocean ActiveSupport :: MessageEncryptor :: InvalidMessage: 嘗試在日志中獲取錯誤ActiveSupport :: MessageEncryptor :: InvalidMessage部署Rails 5.2.0 App

,但沒有人適合我的情況。

我的環境是:

  1. 同一帳戶在遠程計算機上部署了兩個Rails 5.2.0應用程序。
  2. 首先,它們可通過瀏覽器視圖進行部署和使用,並用於Ruby 2.4.1。 這個通過secrets.yml獲取secrets.yml
  3. Rails 5.2.0應用程序的第二個用於Ruby 2.4.2,而獲取密鑰的方式用於config/master.keyconfig/credentials.yml.enc 這是可部署的,但無法通過瀏覽器視圖使用。 由於提交錯誤,我曾經重新生成master.keycredentials.yml.enc master.key文件,並推送到git-remote存儲庫。
  4. 它們的兩個gemset都在同一個rvm中,命名為:rails5.2.0
  5. 通過capistranorails-capistrano gem部署
  6. 他們倆都使用phusion乘客5.3.3 + Apache 2.4.7

對於第二個Rails 5.2.0應用程序,我使用gem dotrailsSECRET_KEY_BASE = '<SECRET_KEY>'放入.env文件中,該文件從shared/目錄軟鏈接到當前版本的遠程rails應用程序的主目錄,並添加一條語句: config.require_master_key = true用於config/environments/production.rb文件。

我已傳輸的文件credentials.yml.encmaster.key從本地機器shared/config/在遠程計算機的滑軌應用程序目錄。 另外,我將文件.env放到遠程計算機的shared/目錄中。

我還將文件列表添加到config/deploy.rblinked_files
append :linked_files, "config/database.yml", "config/credentials.yml.enc", "config/master.key", ".env" set :rvm_custom_path, '/usr/local/rvm' set :rvm_ruby_version, '2.4.2@blogapp-rails-5.2.0-ruby-2.4.2'

我試圖將第二個Rails 5.2.0應用程序部署到遠程機器,但它仍然可以部署,並且無法通過瀏覽器視圖工作。 我希望有人可以解決這種情況。 謝謝。

以下是加載Rails應用程序時錯誤消息的一部分, 詳細消息在我的保管箱鏈接中



    Error: The application encountered the following error: ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::MessageEncryptor::InvalidMessage)
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:184:in `_decrypt'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:79:in `decrypt'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_file.rb:42:in `read'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:21:in `read'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:33:in `config'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/encrypted_configuration.rb:38:in `options'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/core_ext/module/delegation.rb:271:in `method_missing'
        (erb):12:in `'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/erb.rb:896:in `eval'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/erb.rb:896:in `result'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activestorage-5.2.0/lib/active_storage/engine.rb:81:in `block (2 levels) in '
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `instance_eval'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:71:in `block in execute_hook'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:62:in `with_execution_control'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:67:in `execute_hook'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:52:in `block in run_load_hooks'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:51:in `each'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/lazy_load_hooks.rb:51:in `run_load_hooks'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activestorage-5.2.0/app/models/active_storage/blob.rb:206:in `'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activestorage-5.2.0/app/models/active_storage/blob.rb:16:in `'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:370:in `block in require_or_load'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:37:in `block in load_interlock'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:14:in `block in loading'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/concurrency/share_lock.rb:151:in `exclusive'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies/interlock.rb:13:in `loading'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:37:in `load_interlock'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:348:in `require_or_load'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:326:in `depend_on'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/bootsnap-1.3.1/lib/bootsnap/load_path_cache/core_ext/active_support.rb:59:in `depend_on'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:242:in `require_dependency'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:478:in `block (2 levels) in eager_load!'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:477:in `each'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:477:in `block in eager_load!'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:475:in `each'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:475:in `eager_load!'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/engine.rb:356:in `eager_load!'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application/finisher.rb:69:in `each'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application/finisher.rb:69:in `block in '
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `instance_exec'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:32:in `run'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:61:in `block in run_initializers'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:347:in `each'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:347:in `call'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
        /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/initializable.rb:60:in `run_initializers'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/railties-5.2.0/lib/rails/application.rb:361:in `initialize!'
        /var/www/blogApp/releases/20180805160423/config/environment.rb:5:in `'
        config.ru:3:in `require_relative'
        config.ru:3:in `block in '
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `instance_eval'
        /var/www/blogApp/shared/bundle/ruby/2.4.0/gems/rack-2.0.5/lib/rack/builder.rb:55:in `initialize'
        config.ru:1:in `new'
        config.ru:1:in `'
        /usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `eval'
        /usr/share/passenger/helper-scripts/rack-preloader.rb:101:in `preload_app'
        /usr/share/passenger/helper-scripts/rack-preloader.rb:189:in `block in '
        /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:380:in `run_block_and_record_step_progress'
        /usr/share/passenger/helper-scripts/rack-preloader.rb:188:in `'
        /usr/share/passenger/helper-scripts/rack-preloader.rb:30:in `'
        /usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `'

環境變量:



    APACHE_PID_FILE = /var/run/apache2/apache2.pid
    rvm_bin_path = /usr/share/rvm/bin
    PASSENGER_SPAWN_WORK_DIR = /tmp/passenger.spawn.XXXX5nnkfO
    GEM_HOME = /var/www/blogApp/shared/bundle/ruby/2.4.0
    SSL_TLS_SNI = yhblog.csie.io
    APACHE_RUN_USER = www-data
    SHELL = /bin/bash
    IRBRC = /usr/share/rvm/rubies/ruby-2.4.2/.irbrc
    PYTHONUNBUFFERED = 1
    MY_RUBY_HOME = /usr/share/rvm/rubies/ruby-2.4.2
    USER = xxxxuser
    HTTPS = on
    _system_type = Linux
    rvm_path = /usr/share/rvm
    IN_PASSENGER = 1
    RACK_ENV = production
    PASSENGER_USE_FEEDBACK_FD = true
    rvm_prefix = /usr/share
    APACHE_LOG_DIR = /var/log/apache2
    PATH = /var/www/blogApp/shared/bundle/ruby/2.4.0/bin:/home/xxxxuser/.rvm/gems/ruby-2.4.2@rails5.2.0/bin:/home/xxxxuser/.rvm/gems/ruby-2.4.2@global/bin:/usr/share/rvm/rubies/ruby-2.4.2/bin:/usr/local/rvm/bin:/home/xxxxuser/.rvm/wrappers/ruby-2.4.2@rails5.2.0/bin:/home/xxxxuser/.rvm/gems/ruby-2.4.2/bin:/usr/share/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    WSGI_ENV = production
    PWD = /var/www/blogApp/current
    APACHE_RUN_GROUP = www-data
    LANG = C
    NODE_PATH = /usr/share/passenger/node
    _system_arch = x86_64
    NODE_ENV = production
    _system_version = 14.04
    rvm_version = 1.29.4 (manual)
    HOME = /home/xxxxuser
    SHLVL = 0
    RAILS_ENV = production
    rvm_ruby_string = ruby-2.4.2
    SERVER_SOFTWARE = Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.3.3
    LOGNAME = xxxxuser
    GEM_PATH = 
    PASSENGER_APP_ENV = production
    rvmsudo_secure_path = 1
    rvm_delete_flag = 0
    APACHE_LOCK_DIR = /var/lock/apache2
    APACHE_RUN_DIR = /var/run/apache2
    RUBY_VERSION = ruby-2.4.2
    _system_name = Ubuntu
    rvm_silence_path_mismatch_check_flag = 1
    BUNDLER_ORIG_BUNDLE_BIN_PATH = BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL
    BUNDLER_ORIG_BUNDLE_GEMFILE = BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL
    BUNDLER_ORIG_BUNDLER_ORIG_MANPATH = BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL
    BUNDLER_ORIG_BUNDLER_VERSION = BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL
    BUNDLER_ORIG_GEM_HOME = /home/xxxxuser/.rvm/gems/ruby-2.4.2@rails5.2.0
    BUNDLER_ORIG_GEM_PATH = /home/xxxxuser/.rvm/gems/ruby-2.4.2@rails5.2.0:/home/xxxxuser/.rvm/gems/ruby-2.4.2@global
    BUNDLER_ORIG_MANPATH = BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL
    BUNDLER_ORIG_PATH = /home/xxxxuser/.rvm/gems/ruby-2.4.2@rails5.2.0/bin:/home/xxxxuser/.rvm/gems/ruby-2.4.2@global/bin:/usr/share/rvm/rubies/ruby-2.4.2/bin:/usr/local/rvm/bin:/home/xxxxuser/.rvm/wrappers/ruby-2.4.2@rails5.2.0/bin:/home/xxxxuser/.rvm/gems/ruby-2.4.2/bin:/home/xxxxuser/.rvm/gems/ruby-2.4.2@global/bin:/usr/share/rvm/rubies/ruby-2.4.2/bin:/usr/share/rvm/bin:/home/xxxxuser/.rvm/gems/ruby-2.4.2/bin:/home/xxxxuser/.rvm/gems/ruby-2.4.2@global/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    BUNDLER_ORIG_RB_USER_INSTALL = BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL
    BUNDLER_ORIG_RUBYLIB = BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL
    BUNDLER_ORIG_RUBYOPT = BUNDLER_ENVIRONMENT_PRESERVER_INTENTIONALLY_NIL
    BUNDLE_BIN_PATH = /home/xxxxuser/.rvm/gems/ruby-2.4.2@global/gems/bundler-1.16.3/exe/bundle
    BUNDLE_GEMFILE = /var/www/blogApp/releases/20180805160423/Gemfile
    BUNDLER_VERSION = 1.16.3
    RUBYOPT = -rbundler/setup
    RUBYLIB = /usr/share/rvm/rubies/ruby-2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.3/lib
    SECRET_KEY_BASE = 6e6b750cfcd6dd788a29cf7fd9a2d8722e207d3f2f0e90eec5a72e318ba719386126ee3513d53e3b3727057213b3aa9c43a96b08f62de0df1c0def9a9202f72b
    RAILS_MASTER_KEY = 25a3611d36b773ca1b03277a02cf43f8

活化寶石:



    did_you_mean => 1.1.0
    bundler => 1.16.3
    io-console => 0.4.6
    rake => 12.3.1
    concurrent-ruby => 1.0.5
    i18n => 1.0.1
    minitest => 5.11.3
    thread_safe => 0.3.6
    tzinfo => 1.2.5
    activesupport => 5.2.0
    builder => 3.2.3
    erubi => 1.7.1
    mini_portile2 => 2.3.0
    nokogiri => 1.8.4
    rails-dom-testing => 2.0.3
    crass => 1.0.4
    loofah => 2.2.2
    rails-html-sanitizer => 1.0.4
    actionview => 5.2.0
    rack => 2.0.5
    rack-test => 1.1.0
    actionpack => 5.2.0
    nio4r => 2.3.1
    websocket-extensions => 0.1.3
    websocket-driver => 0.7.0
    actioncable => 5.2.0
    globalid => 0.4.1
    activejob => 5.2.0
    mini_mime => 1.0.0
    mail => 2.7.0
    actionmailer => 5.2.0
    activemodel => 5.2.0
    arel => 9.0.0
    activerecord => 5.2.0
    mimemagic => 0.3.2
    marcel => 0.3.2
    activestorage => 5.2.0
    execjs => 2.7.0
    autoprefixer-rails => 9.0.2
    bcrypt => 3.1.11
    msgpack => 1.2.4
    bootsnap => 1.3.1
    popper_js => 1.14.3
    rb-fsevent => 0.10.3
    ffi => 1.9.25
    rb-inotify => 0.9.10
    sass-listen => 4.0.0
    sass => 3.5.7
    bootstrap => 4.1.3
    coffee-script-source => 1.12.2
    coffee-script => 2.4.1
    method_source => 0.9.0
    thor => 0.20.0
    railties => 5.2.0
    coffee-rails => 4.2.2
    orm_adapter => 0.5.0
    responders => 2.4.0
    warden => 1.2.7
    devise => 4.4.3
    dotenv => 2.3.0
    dotenv-rails => 2.3.0
    multi_json => 1.13.1
    jbuilder => 2.7.0
    jquery-rails => 4.3.3
    kaminari-core => 1.1.1
    kaminari-actionview => 1.1.1
    kaminari-activerecord => 1.1.1
    kaminari => 1.1.1
    pg => 1.0.0
    puma => 3.12.0
    sprockets => 3.7.2
    sprockets-rails => 3.2.1
    rails => 5.2.0
    tilt => 2.0.8
    sass-rails => 5.0.7
    sassc => 1.12.1
    sqlite3 => 1.3.13
    turbolinks-source => 5.1.0
    turbolinks => 5.1.1
    uglifier => 4.1.16

經過研究,我承認我的答案甚至都沒有,而且是錯誤的。 我猜這個鍵必須設置。 什么secrets.yml包含? 也許您的第二個應用程序嘗試使用第一個應用程序的秘密

<activesupport::messageencryptor::invalidmessage: activesupport::messageencryptor::invalidmessage error when deploying to heroku rails 5.2.3< div><div id="text_translate"><p> 我在將我的 React on Rails 應用程序部署到 Heroku 時遇到了很多麻煩。 我已經閱讀並嘗試了無數關於如何解決 secret_key_base 和 rails_master_key 問題的帖子:</p><p> <a href="https://stackoverflow.com/questions/54277392/activesupportmessageencryptorinvalidmessage" rel="nofollow noreferrer">ActiveSupport::MessageEncryptor::InvalidMessage</a></p><p> <a href="https://stackoverflow.com/questions/50102639/running-a-rails-server-in-production-locally-invalidmessage-error" rel="nofollow noreferrer">在本地運行 Rails 服務器(InvalidMessage 錯誤)</a></p><p> 對這些都沒有任何運氣,並且似乎對用於解決這些問題的許多實踐進行了很好的辯論(從我讀過的答案來看)。</p><p> 這是我在 Heroku 日志中遇到的錯誤:</p><pre> 2019-10-23T15:27:31.187947+00:00 app[web.1]: 2019-10-23 15:27:31 +0000: Rack app error handling request { GET / } 2019-10-23T15:27:31.18796+00:00 app[web.1]: #&lt;ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage&gt; 2019-10-23T15:27:31.187962+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' 2019-10-23T15:27:31.187964+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:184:in `_decrypt' 2019-10-23T15:27:31.187966+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' 2019-10-23T15:27:31.187968+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' 2019-10-23T15:27:31.187971+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:44:in `decrypt' 2019-10-23T15:27:31.187973+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:81:in `preprocess' 2019-10-23T15:27:31.187975+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:29:in `block in parse' 2019-10-23T15:27:31.187977+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each' 2019-10-23T15:27:31.187979+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each_with_object' 2019-10-23T15:27:31.187981+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `parse' 2019-10-23T15:27:31.187983+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:399:in `secrets' 2019-10-23T15:27:31.187985+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:252:in `env_config' 2019-10-23T15:27:31.187987+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:706:in `build_request' 2019-10-23T15:27:31.18799+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:608:in `build_request' 2019-10-23T15:27:31.187992+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:523:in `call' 2019-10-23T15:27:31.187994+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 2019-10-23T15:27:31.187996+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 2019-10-23T15:27:31.187997+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 2019-10-23T15:27:31.187999+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 2019-10-23T15:27:31.188001+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread' 2019-10-23T15:27:31.447079+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=glacial-woodland-16769.herokuapp.com request_id=922c9b94-3b2b-43fd-9cec-b5eb2d78e21f fwd="8.20.20.246" dyno=web.1 connect=1ms service=16ms status=500 bytes=154 protocol=https 2019-10-23T15:27:31.445658+00:00 app[web.1]: 2019-10-23 15:27:31 +0000: Rack app error handling request { GET /favicon.ico } 2019-10-23T15:27:31.445671+00:00 app[web.1]: #&lt;ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage&gt; 2019-10-23T15:27:31.445673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' 2019-10-23T15:27:31.445675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:184:in `_decrypt' 2019-10-23T15:27:31.445677+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' 2019-10-23T15:27:31.445679+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' 2019-10-23T15:27:31.445681+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:44:in `decrypt' 2019-10-23T15:27:31.445683+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:81:in `preprocess' 2019-10-23T15:27:31.445685+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:29:in `block in parse' 2019-10-23T15:27:31.445687+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each' 2019-10-23T15:27:31.445688+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each_with_object' 2019-10-23T15:27:31.44569+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `parse' 2019-10-23T15:27:31.445693+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:399:in `secrets' 2019-10-23T15:27:31.445695+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:252:in `env_config' 2019-10-23T15:27:31.445697+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:706:in `build_request' 2019-10-23T15:27:31.445699+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:608:in `build_request' 2019-10-23T15:27:31.445701+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:523:in `call' 2019-10-23T15:27:31.445703+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 2019-10-23T15:27:31.445705+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 2019-10-23T15:27:31.445707+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 2019-10-23T15:27:31.445709+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 2019-10-23T15:27:31.446389+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread'</pre><p> 將不勝感激任何幫助,並可以提供我可能遺漏的任何細節。 我對 Heroku 比較陌生,所以我可能只是忽略了一些明顯的事情,如果是這種情況,我深表歉意!</p></div></activesupport::messageencryptor::invalidmessage:>

[英]<ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage Error when deploying to Heroku Rails 5.2.3

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

相關問題 導軌:ActiveSupport::MessageEncryptor::InvalidMessage Rails 6 Heroku Devise 錯誤 ActiveSupport::MessageEncryptor::InvalidMessage <activesupport::messageencryptor::invalidmessage: activesupport::messageencryptor::invalidmessage error when deploying to heroku rails 5.2.3< div><div id="text_translate"><p> 我在將我的 React on Rails 應用程序部署到 Heroku 時遇到了很多麻煩。 我已經閱讀並嘗試了無數關於如何解決 secret_key_base 和 rails_master_key 問題的帖子:</p><p> <a href="https://stackoverflow.com/questions/54277392/activesupportmessageencryptorinvalidmessage" rel="nofollow noreferrer">ActiveSupport::MessageEncryptor::InvalidMessage</a></p><p> <a href="https://stackoverflow.com/questions/50102639/running-a-rails-server-in-production-locally-invalidmessage-error" rel="nofollow noreferrer">在本地運行 Rails 服務器(InvalidMessage 錯誤)</a></p><p> 對這些都沒有任何運氣,並且似乎對用於解決這些問題的許多實踐進行了很好的辯論(從我讀過的答案來看)。</p><p> 這是我在 Heroku 日志中遇到的錯誤:</p><pre> 2019-10-23T15:27:31.187947+00:00 app[web.1]: 2019-10-23 15:27:31 +0000: Rack app error handling request { GET / } 2019-10-23T15:27:31.18796+00:00 app[web.1]: #&lt;ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage&gt; 2019-10-23T15:27:31.187962+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' 2019-10-23T15:27:31.187964+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:184:in `_decrypt' 2019-10-23T15:27:31.187966+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' 2019-10-23T15:27:31.187968+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' 2019-10-23T15:27:31.187971+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:44:in `decrypt' 2019-10-23T15:27:31.187973+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:81:in `preprocess' 2019-10-23T15:27:31.187975+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:29:in `block in parse' 2019-10-23T15:27:31.187977+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each' 2019-10-23T15:27:31.187979+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each_with_object' 2019-10-23T15:27:31.187981+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `parse' 2019-10-23T15:27:31.187983+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:399:in `secrets' 2019-10-23T15:27:31.187985+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:252:in `env_config' 2019-10-23T15:27:31.187987+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:706:in `build_request' 2019-10-23T15:27:31.18799+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:608:in `build_request' 2019-10-23T15:27:31.187992+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:523:in `call' 2019-10-23T15:27:31.187994+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 2019-10-23T15:27:31.187996+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 2019-10-23T15:27:31.187997+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 2019-10-23T15:27:31.187999+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 2019-10-23T15:27:31.188001+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread' 2019-10-23T15:27:31.447079+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=glacial-woodland-16769.herokuapp.com request_id=922c9b94-3b2b-43fd-9cec-b5eb2d78e21f fwd="8.20.20.246" dyno=web.1 connect=1ms service=16ms status=500 bytes=154 protocol=https 2019-10-23T15:27:31.445658+00:00 app[web.1]: 2019-10-23 15:27:31 +0000: Rack app error handling request { GET /favicon.ico } 2019-10-23T15:27:31.445671+00:00 app[web.1]: #&lt;ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage&gt; 2019-10-23T15:27:31.445673+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:206:in `rescue in _decrypt' 2019-10-23T15:27:31.445675+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:184:in `_decrypt' 2019-10-23T15:27:31.445677+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/message_encryptor.rb:157:in `decrypt_and_verify' 2019-10-23T15:27:31.445679+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/messages/rotator.rb:21:in `decrypt_and_verify' 2019-10-23T15:27:31.445681+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:44:in `decrypt' 2019-10-23T15:27:31.445683+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:81:in `preprocess' 2019-10-23T15:27:31.445685+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:29:in `block in parse' 2019-10-23T15:27:31.445687+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each' 2019-10-23T15:27:31.445688+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `each_with_object' 2019-10-23T15:27:31.44569+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/secrets.rb:26:in `parse' 2019-10-23T15:27:31.445693+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:399:in `secrets' 2019-10-23T15:27:31.445695+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:252:in `env_config' 2019-10-23T15:27:31.445697+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:706:in `build_request' 2019-10-23T15:27:31.445699+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/application.rb:608:in `build_request' 2019-10-23T15:27:31.445701+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/railties-5.2.3/lib/rails/engine.rb:523:in `call' 2019-10-23T15:27:31.445703+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/configuration.rb:227:in `call' 2019-10-23T15:27:31.445705+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:660:in `handle_request' 2019-10-23T15:27:31.445707+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:474:in `process_client' 2019-10-23T15:27:31.445709+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/server.rb:334:in `block in run' 2019-10-23T15:27:31.446389+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/puma-3.12.1/lib/puma/thread_pool.rb:135:in `block in spawn_thread'</pre><p> 將不勝感激任何幫助,並可以提供我可能遺漏的任何細節。 我對 Heroku 比較陌生,所以我可能只是忽略了一些明顯的事情,如果是這種情況,我深表歉意!</p></div></activesupport::messageencryptor::invalidmessage:> Rails部署Digitalocean ActiveSupport :: MessageEncryptor :: InvalidMessage: 嘗試部署Rails 5.2.0 App時在日志中獲取錯誤ActiveSupport :: MessageEncryptor :: InvalidMessage 如何修復憑據錯誤-ActiveSupport :: MessageEncryptor :: InvalidMessage Rails 5.2 with master.key Digital Ocean 部署:ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage GitHub Actions 上的 Rails Master Key 導致 ActiveSupport::MessageEncryptor::InvalidMessage 憑據導致的測試問題 (ActiveSupport::MessageEncryptor::InvalidMessage) 上限生產部署| ActiveSupport::MessageEncryptor::InvalidMessage 原因:OpenSSL::Cipher::CipherError:
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM