You've edited your master.key or credentials.yml.enc file in VScode, and are running into issues when you saved the file because your editor is configured to ensure files have a trailing newline and rails doesn't strip the content before decrypting it.
How to prevent VScode from adding a trailing newline to specific file extensions
57 Views Asked by Allison At
2
There are 2 best solutions below
4
On
All projects should have an https://editorconfig.org/ file. And all devs should configure their editors to use it.
I generally only read/write that type of file in Vi or BBEdit, but you can get around this in VScode by configuring those file extensions to use a specific Language Mode and then disable the setting for that Language Mode:
Note: The settings documentation leaves something to be desired, but you effectively need to use an identifier recognized as a VScode valid Language Mode (i.e., the feature that VScode uses to determine which syntax highlighting to use for your file). I am using
shellscripthere, which is VScode's identifier for theShell ScriptLanguage Mode.