deploying rails showing error "Missing encryption key".

github logo ・1 min read

Hello,
I am using rails credentials in production. Like the following image. But when i am trying to upload it to digitalocean, it is showing errors

Rake aborted!
01 NoMethodError: undefined method `[]' for nil:NilClass

Where is the problem in this code?

This is my credential structure, and i am calling those credentials with the following.


:user_name => Rails.application.credentials.sendgrid[:user_name],
:password => Rails.application.credentials.sendgrid[:password],

How can i solve this problem?

twitter logo DISCUSS (2)
markdown guide
 

I have got the solution.
By adding the master key to the production.
these following tuts really help me to get out of this problem.

waiyanyoon.com/deploying-rails-5-2...
engineyard.com/blog/rails-encrypte...

 

I would highly recommend keeping your master key in a secure place. Making a private Github GIST would do the trick. You want to have it securely stored in cases where you need to clone your repo to another computer or some freak accident happens that causes you to lose your master key.

Classic DEV Post from May 15

What are your five most used terminal commands?

community post to share our most used terminal commands.

SMEHSAN profile image