Rails Deploy Digitalocean ActiveSupport::MessageEncryptor::InvalidMessage:

痞子三分冷 提交于 2019-12-14 03:44:44

问题


I'm deploying an app on digitalocean following this guide: https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma#prerequisites

When I deploy with cap cap production deploy:initial --trace I keep getting this error

The deploy stops here: 01 ~/.rvm/bin/rvm default do bundle exec rake assets:precompile 01 rake aborted! 01 01 ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::Inva… 01

and when I run bundle exec rake assets:precompile locally I get yarn install v1.7.0 [1/4] 🔍 Resolving packages... success Already up-to-date. ✨ Done in 0.05s.

I also installed yarn on the ubuntu server. I've made sure my ssh keys on the server are the same as my local ssh keys under ~/.ssh/id_rsa.pub and ~/.ssh/id_rsa

I was thinking it was an SSH issue, but I think it might be something else since I've thoroughly followed online guides on digitalocean and elsewhere.

Any help would be appreciated!


回答1:


This error was fixed by setting the secret keybase using export.

export SECRET_KEY_BASE="secret key" 

To find or set your secret key in rails 5.2 use

rails credentials:edit

or if you haven't set your editor

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

copy that secret key and then use the export line



来源:https://stackoverflow.com/questions/50788808/rails-deploy-digitalocean-activesupportmessageencryptorinvalidmessage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!