Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 840803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:41:11+00:00 2026-05-15T05:41:11+00:00

I have a rails app running on Heroku. I am using paperclip for some

  • 0

I have a rails app running on Heroku. I am using paperclip for some simple image uploads for user avatars and some other things, I have S3 set as my backend and everything seems to be working fine except when trying to push to S3 I get the following error:

The AWS Access Key Id you provided does not exist in our records. 

Thinking I mis-pasted my access key and secret key, I tried again, still no luck. Thinking maybe it was just a buggy key I deactivated it and generated a new one. Still no luck.

Now for both keys I have used the S3 browser app on OS X and have been able to connect to each and view my current buckets and add/delete buckets. Is there something I should be looking out for? I have my application’s S3 and paperclip setup like so

development:
  bucket: (unique name)
  access_key_id: ENV['S3_KEY']
  secret_access_key: ENV['S3_SECRET']

test:
  bucket: (unique name)
  access_key_id: ENV['S3_KEY']
  secret_access_key: ENV['S3_SECRET']

production:
  bucket: (unique_name)
  access_key_id: ENV['S3_KEY']
  secret_access_key: ENV['S3_SECRET']

has_attached_file :cover,
    :styles => {
      :thumb => "50x50"
    },
    :storage => :s3,
    :s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
    :path => ":class/:id/:style/:filename"

EDIT NOTE: The ENV[‘S3_KEY’] and ENV[‘S3_SECRET’] are environment variables in heroku which i have tried even using my keys directly and it still doesn’t work

Note: I just added the (unique name) bits, those aren’t actually there–I have also verified bucket names, but I don’t even think this is getting that far. I also have my heroku environment vars setup correctly and have them setup on dev

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:41:12+00:00Added an answer on May 15, 2026 at 5:41 am

    You aren’t setting a bucket. It’s in your s3.yml file, but you aren’t reading that value from your call to has_attached_file.

    Paperclip S3 docs:
    http://rubydoc.info/gems/paperclip/Paperclip/Storage/S3#s3_protocol-instance_method

    Also, pay attention to those people who are telling you not to use a s3.yml file with Heroku. It’s a waste and just added abstraction that buys you nothing. You already have your ENV set up with the values you need, so use them.

    I’ve done this before where I don’t want to push an s3.yml file to Heroku, but I do want to use one for test and development. In an initializer you can do something like this:

    # If an s3.yml file exists, use the key, secret key, and bucket values from there.
    # Otherwise, pull them from the environment.
    if File.exists?("#{Rails.root}/config/s3.yml")
      s3_config = YAML.load_file("#{Rails.root}/config/s3.yml")
      S3[:key] = s3_config[Rails.env]['key']
      S3[:secret] = s3_config[Rails.env]['secret']
      S3[:bucket] = s3_config[Rails.env]['bucket']
    else
      S3[:key] = ENV['S3_KEY']
      S3[:secret] = ENV['S3_SECRET']
      S3[:bucket] = ENV['S3_BUCKET']
    end
    

    Then when you’re setting up Paperclip in your model, you reference the value like this:

    ...
    :s3_credentials => {
      :access_key_id => S3[:key],
      :secret_access_key => S3[:secret]
    },
    :bucket => S3[:bucket]
    

    Obviously, this means that you do not want to have your s3.yml file in your git repository (which really, you shouldn’t anyway).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a web app running on Rails, using Devise and OmniAuth for user
I have a Rails app running Mongoid on Heroku and I need to set
I have a single-threaded Rails app running on thin in single-threaded mode on Heroku
I have this RoR app that calls to RAILS_ROOT. When running it using rails
I have a Rails 3 app running on Heroku and I also have a
We are using Rails 3.0.X and running our web app on Heroku. We are
I have a rails app running a thin server on heroku. It currently uses
We have a rails app running on the Heroku Cedar stack, and we have
I have an application running in Heroku. The app has a User model with
I am running a Rails 3.0.9 app on Heroku's Cedar stack and have S3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.