ruby 01参数错误:“生产”环境缺少“secret_key_base”,请使用“bin/rails凭据:edit”设置此字符串

kwvwclae  于 2023-03-12  发布在  Ruby
关注(0)|答案(1)|浏览(125)

将新创建的master.key文件从我的开发服务器复制到生产服务器并运行

cap production deploy

我收到此错误消息:

00:13 deploy:assets:precompile
  01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
  01 rake aborted!
  01 ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit`

解决此问题的下一个最佳步骤是什么?

hpcdzsge

hpcdzsge1#

为生产环境设置密钥secret_key_base。应该已经为开发环境设置了此密钥。您还需要为生产环境设置此密钥。您可以通过运行命令bin/rails credentials:edit来完成此操作。

production:
      secret_key_base: '<SECRET_KEY_VALUE>'

相关问题