在Heroku上部署Rails 5.2.2应用程序时,部署会顺利进行,但是如果我检查日志(使用heroku logs
),则会得到无法加载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
答案 0 :(得分:0)
当您缺少RAILS_MASTER_KEY
时会发生这种情况,应该由环境变量(heroku config:set RAILS_MASTER_KEY=xxxxxxxx
)设置,其中xxxxxxxxx是您的主密钥