'Capistrano Deployment Error using Rails version 7

I have an app built with Ruby on Rails version 7.0.2, and I want to deploy it to a VPS using Capistrano Gem, however when it is about to reach near the end of deployment, I get this error: "ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit"

When I try to run, EDITOR="code --wait" bin/rails credentials:edit and I enter a secret base key, I push it to github repo, then try to deploy, I still get the same error.

How can I solve this if anyone knows the solution?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source