简体   繁体   中英

I am deploying Rails6 app using Capistrano. Deploying fails

I am trying to deploy my Rails 6 app to the server using Capistrano.

and I confronted this error message.

Missing `secret_key_base` for 'production' environment, set this string with `rails credentials:edit`

Many other posts and article suggest some way with secret.yml file. but I wan not able to do it. Since I don't have a secret.yml file in the app as I am on Rails 6.

UPDATE .

I manually made file in folder. config/secrets.yml

production:
  secret_key_base: ******************************

Still getting same errors.

I found a workaround. Or solution maybe. I did the following things.

1. Server Side.

in your server - yourappfolder/shared/config/ make `secrets.yml' file and write details.

deploy@xx.xx.xx.xx.:~/myapp/shared/config$ ls
secrets.yml

secrets.yml

production:
  secret_key_base: something---key------

2. Local machine

in your - config/envirenments/production.rb update this.

config.require_master_key = false

Create config/secrets.yml and write the desired values.

Or

Set secret_key_base in application.rb

config.secret_key_base = 'blipblapblup'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM