I'm having an issue deploying my rails 6 app to Digital Ocean using spaces. After the deploy, the webserver fails. In the Puma logs I find:
Unable to load application: Aws::Sigv4::Errors::MissingCredentialsError: missing credentials, provide credentials with one of the following options:
Feb 05 03:33:25: - :access_key_id and :secret_access_key
Feb 05 03:33:25: - :credentials
Feb 05 03:33:25: - :credentials_provider
Here is my relevant rails setup:
gem file
gem 'aws-sdk-s3'
config/storage.yml
digitalocean_spaces:
service: S3
access_key_id: <%= Rails.application.credentials.dig(:digitalocean_spaces, :access_key_id) %>
secret_access_key: <%= Rails.application.credentials.dig(:digitalocean_spaces, :secret_access_key) %>
region: nyc3
endpoint: 'https://nyc3.digitaloceanspaces.com'
bucket: foobar-bucket
environments/production.rb
config.active_storage.service = :digitalocean_spaces
credentials.yml.enc
digitalocean_spaces:
access_key_id: foobar
secret_access_key: secretfoobar
question from:
https://stackoverflow.com/questions/66063998/why-are-my-rails-credentials-for-digital-ocean-spaces-not-being-found-after-depl 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…