Rails部署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资产时:在本地预编译我得到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 

复制该密钥然后使用导出行