簡體   English   中英

Rails部署Digitalocean ActiveSupport :: MessageEncryptor :: InvalidMessage:

[英]Rails Deploy Digitalocean ActiveSupport::MessageEncryptor::InvalidMessage:

我正在按照此指南在digitalocean上部署應用程序: https : //www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-彪馬#先決條件

當我使用cap cap production deploy:initial --trace我一直收到此錯誤

部署在此處停止: 01 ~/.rvm/bin/rvm default do bundle exec rake assets:precompile 01 rake aborted! 01 01 ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::Inva… 01 01 ~/.rvm/bin/rvm default do bundle exec rake assets:precompile 01 rake aborted! 01 01 ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::Inva… 01

當我在本地運行bundle exec rake asset:precompile時,我會得到yarn install v1.7.0 [1/4] 🔍 Resolving packages... success Already up-to-date. ✨ Done in 0.05s. yarn install v1.7.0 [1/4] 🔍 Resolving packages... success Already up-to-date. ✨ Done in 0.05s.

我還在ubuntu服務器上安裝了yarn。 我確保服務器上的ssh密鑰與〜/ .ssh / id_rsa.pub和〜/ .ssh / id_rsa下的本地ssh密鑰相同

我當時以為這是SSH問題,但自從我完全遵循digitalocean和其他地方的在線指南后,我認為可能還有其他問題。

任何幫助,將不勝感激!

通過使用export設置密鑰庫,此錯誤已得到解決。

export SECRET_KEY_BASE="secret key" 

要在Rails 5.2中查找或設置您的秘密密鑰,請使用

rails credentials:edit

或者如果您尚未設置編輯器

EDITOR="vim --wait" rails credentials:edit

復制該密鑰,然后使用導出行

<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 5.2 with master.key Digital Ocean 部署:ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage 嘗試部署Rails 5.2.0 App時在日志中獲取錯誤ActiveSupport :: MessageEncryptor :: InvalidMessage Rails 5.2.0加載應用程序錯誤:ActiveSupport :: MessageEncryptor :: InvalidMessage(ActiveSupport :: MessageEncryptor :: InvalidMessage 上限生產部署| ActiveSupport::MessageEncryptor::InvalidMessage 原因:OpenSSL::Cipher::CipherError: GitHub Actions 上的 Rails Master Key 導致 ActiveSupport::MessageEncryptor::InvalidMessage 如何修復憑據錯誤-ActiveSupport :: MessageEncryptor :: InvalidMessage 憑據導致的測試問題 (ActiveSupport::MessageEncryptor::InvalidMessage)
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM