After deploying the portfolio to AWS, I got a title error during local development and it took a long time to resolve, so I will post a workaround as a memorandum.
It is designed to open credential.yml.enc using master.key, but it is throwing an error because it cannot be opened. Therefore, it is necessary to recreate credential.yml.enc.
$ EDITOR=vim bin/rails credetials:edit
This command combines the encrypted file with master.key, edits it with the specified editor, and saves the result again encrypted. Also, if you don't have master.key, it will create a new one, and if you don't have credentials.yml.enc, it will create a new one. Therefore, delete the existing credential.yml.enc and solve it with the above command.
However, my local environment is on the Docker container, so a little special command is required. First, log in to the server and install vim.
On EC2 server
$ apt-get install -y vim
Local environment
$ docker-compose run -e EDITOR=vim web rails credentials:edit
Starting live_share_db_1 ... done
File encrypted and saved.
Now I don't throw any errors ^^
https://qiita.com/at-946/items/8630ddd411d1e6a651c6 https://qiita.com/zenfumi/items/4a7cbab59f0f7ede0d6e
Recommended Posts