chrichar
chrichar

Reputation: 11

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

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!

Upvotes: 0

Views: 1114

Answers (1)

chrichar
chrichar

Reputation: 11

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

Upvotes: 1

Related Questions