title: How to retrieve attachment url with Rails Active Storage with S3
body: <pre><code>rails version 5.2
  </code></pre>
  <p>I have a scenario where I need to access the public URL of Rails Active Storage with Amazon S3 storage to make a zip file with Sidekiq background job.</p>
  <p>I am having difficulty getting the actual file URL. I have tried <code>rails_blob_url</code> but it gives me following</p>
  <pre><code>http://localhost:3000/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBZUk9IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--9598613be650942d1ee4382a44dad679a80d2d3b/sample.pdf
  </code></pre>
  <p>How do I access the real file URL through Sidekiq?</p>
  <p>storage.yml</p>
  <pre><code>test:
    service: Disk
    root: &lt;%= Rails.root.join(&quot;tmp/storage&quot;) %&gt;
  
  local:
    service: Disk
    root: &lt;%= Rails.root.join(&quot;storage&quot;) %&gt;
  
  development:
    service: S3
    access_key_id: 'xxxxx'
    secret_access_key: 'xxxxx'
    region: 'xxxxx'
    bucket: 'xxxxx'
  </code></pre>
  <p>development.rb</p>
  <pre><code>  config.active_storage.service = :development
  </code></pre>
  <p>I can access fine these on web interface but not within Sidekiq</p>