Skip to main content
Ask A Question
Notifications
You’re not receiving notifications from this thread.
Subscribe

Cloned my project from Git and now have an Error accessing credentials.yml.enc

Rails • Asked by Jim Miller

Hi all,

I cloned my project to my laptop but when I try to access credentials.yml.enc with rails credentials:edit, I get this error:

Couldn't decrypt config/credentials.yml.enc. Perhaps you passed the wrong key?

Can anyone give me the steps to properly reset my credentials.yml in a cloned repo?

Thanks,

Jim


Hey Jim!

Since the credentials file contains API keys and other secrets, only the encrypted file gets stored in git. The matching config/credentials.key contains the key to decrypt that file. The key should not be stored in the repo, otherwise it wouldn't be secure and you might as well store the keys in plain text.

So you'll have to grab the config/credentials.key file from your other computer and add it to your laptop.

Keep that key safe like a password. It's the only way to decrypt the credentials.


lol. that sucks. I'm in Fla and my computer is in PA. I guess it defeats the purpose, but can it be reset locally so I can finish my tutorial? ":)


Doh! You can delete the file and generate new credentials. That's probably the easiest option and then you can save the .key file somewhere safe this time. 😅


that sounds good! live and learn. luckily this is only a tutorial.

thanks Chris


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 30,005+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.