gpt4 book ai didi

ruby-on-rails - 无法解密 config/credentials.yml.enc

转载 作者:行者123 更新时间:2023-12-04 02:43:35 25 4
gpt4 key购买 nike

我将 Heroku 与 Rails 6 和 Postgres 结合使用。我正在尝试使用 heroku open 启动应用程序,但构建失败,这在日志中显示:

-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
DEPRECATION WARNING: Including LoggerSilence is deprecated and will be removed in Rails 6.1. Please use `ActiveSupport::LoggerSilence` instead (called from <top (required)> at /tmp/build_9537ba0878cb8933c15686548eb3ccb5/config/application.rb:7)
Missing encryption key to decrypt file with. Ask your team for your master key and write it to /tmp/build_9537ba0878cb8933c15686548eb3ccb5/config/master.key or put it in the ENV['RAILS_MASTER_KEY'].
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed

我已经尝试运行这两个链接中提到的一些命令,但似乎都不起作用:

https://github.com/rails/rails/issues/32947

Ask your team for your master key and put it in ENV["RAILS_MASTER_KEY"] on heroku deploy

我还想知道这些工作流是否是特定于环境的。

最佳答案

您需要将 rails 主 key 作为环境变量添加到 heroku

  1. 将主 key 复制到您计算机的config/master.key 文件中
  2. 将主 key 作为环境变量添加到heroku

    heroku config:set RAILS_MASTER_KEY=your-master-key

关于ruby-on-rails - 无法解密 config/credentials.yml.enc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58148961/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com