title: Cannot load Rails.config.active_storage.service
body: <p>I'm setting up a new rails 5.2 app utilising Active Storage and using AWS for the hosting of images in production.</p>
  
  <p>However, I'm having an issue with the app reading the credentials:</p>
  
  <pre><code>2018-07-06T08:11:52.625415+00:00 app[web.1]: ! Unable to load application: Aws::Sigv4::Errors::MissingCredentialsError: Cannot load `Rails.config.active_storage.service`:
  2018-07-06T08:11:52.625432+00:00 app[web.1]: missing credentials, provide credentials with one of the following options:
  2018-07-06T08:11:52.625435+00:00 app[web.1]:   - :access_key_id and :secret_access_key
  2018-07-06T08:11:52.625437+00:00 app[web.1]:   - :credentials
  2018-07-06T08:11:52.625479+00:00 app[web.1]:   - :credentials_provider
  </code></pre>
  
  <p>This is an existing S3 Bucket which I created a new user just for this app. I'm happy with the CORS etc.</p>
  
  <p>The user is set up under the S3FullAccess group.</p>
  
  <p>I've edited the credentials in my app via <code>$EDITOR="atom --wait" rails credentials:edit</code></p>
  
  <p>The contents of the file:</p>
  
  <pre><code>aws:
    access_key_id: [my access key]
    secret_access_key: [my secrect key]
  
  # Used as the base secret for all MessageVerifiers in Rails, including the one protecting cookies.
  secret_key_base: [my secret key base]
  </code></pre>
  
  <p>Appreciate this is in YAML format, I have played with using one space, and one tab on the keys, but this doesn't seem to make a difference.</p>
  
  <p>When I save and close the file, the terminal writes <code>New credentials encrypted and saved.</code></p>
  
  <p>I also have <code>gem 'aws-sdk-s3', '~&gt;1', require: false</code> installed.</p>
  
  <p>And config/storage.yml</p>
  
  <pre><code>test:
    service: Disk
    root: &lt;%= Rails.root.join("tmp/storage") %&gt;
  
  local:
    service: Disk
    root: &lt;%= Rails.root.join("storage") %&gt;
  
  # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
  amazon:
    service: S3
    access_key_id: &lt;%= Rails.application.credentials.dig(:aws, :access_key_id) %&gt;
    secret_access_key: &lt;%= Rails.application.credentials.dig(:aws, :secret_access_key) %&gt;
    region: eu-west-2
    bucket: [mybucket]
  </code></pre>
  
  <p>Any suggestions on what I might be doing wrong?</p>