简体   繁体   中英

Rails Deploy Digitalocean ActiveSupport::MessageEncryptor::InvalidMessage:

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 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. 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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM