How to run 'rails credentials:edit' on Windows 10 without installing a Linux Subsystem
I didn't find any of the answers above worked for me. Notepad complained about the directory being incorrect and gave me a blank file.
I got it to work with Notepad++ by doing the following:
SET EDITOR="C:\Program Files\Notepad++\notepad++.exe"
rails credentials:edit
I didn't need to use the --wait
flag.
I'm using VS Code and Powershell within VS Code, and this works for me:
> $env:EDITOR="code --wait"
> rails credentials:edit
Credit goes to this article https://flexpoint.tech/2020/05/16/editing-rails-6-0-credentials-on-windows/ by J. Pablo Fernández
I would suggest you switch to non-windows based system if you're trying to do any rails development as I used to work on a windows machine until I caved in and switched entirely to Mate Linux. It would be so much easier to develop Rails application on Linux platform since you would see almost all gems compiling without any issue and all the rails terminal commands are working without further setup.
However, if you would like to edit your credentials, you need a text editor (Usually vim on Linux) setup before running credentials:edit.
First run SET EDITOR="notepad_path"
and then try running rails credentials:edit
You can change notepad_path to any other text editor you prefer. However, some editors like Atom was giving weird issues for me.