Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

puma - Why are my rails credentials for digital ocean spaces not being found after deploying?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...