【问题标题】:On Heroku with Rails 5.2, Cannot load `Rails.config.active_storage.service`: (Aws::Sigv4::Errors::MissingCredentialsError)在带有 Rails 5.2 的 Heroku 上,无法加载“Rails.config.active_storage.service”:(Aws::Sigv4::Errors::MissingCredentialsError)
【发布时间】:2019-06-10 13:13:39
【问题描述】:

在 Heroku 上部署 Rails 5.2.2 应用程序时,部署通过,但如果我检查我的日志(使用 heroku logs)我得到 Cannot load Rails.config.active_storage.service: (Aws::Sigv4::Errors: :MissingCredentialsError)

2019-06-10T13:00:23.884108+00:00 app[web.1]: /app/vendor/bundle/ruby/2.4.0/gems/aws-sigv4-1.1.0/lib/aws-sigv4/signer.rb:612:in `extract_credentials_provider': Cannot load `Rails.config.active_storage.service`: (Aws::Sigv4::Errors::MissingCredentialsError)
2019-06-10T13:00:23.884187+00:00 app[web.1]: missing credentials, provide credentials with one of the following options:
2019-06-10T13:00:23.884200+00:00 app[web.1]: - :access_key_id and :secret_access_key
2019-06-10T13:00:23.884208+00:00 app[web.1]: - :credentials
2019-06-10T13:00:23.884233+00:00 app[web.1]: - :credentials_provider

【问题讨论】:

    标签: heroku rails-activestorage


    【解决方案1】:

    当您缺少 RAILS_MASTER_KEY 时会发生这种情况,您应该通过环境变量 (heroku config:set RAILS_MASTER_KEY=xxxxxxxx) 设置它,其中 xxxxxxxxx 是您的主密钥

    【讨论】:

      猜你喜欢
      • 2018-12-14
      • 2018-06-10
      • 1970-01-01
      • 1970-01-01
      • 2017-04-14
      • 2018-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多