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 7621639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:14:44+00:00 2026-05-31T04:14:44+00:00

I have a pretty straightforward model and attachment has_attached_file :upload, :storage => :s3, :bucket

  • 0

I have a pretty straightforward model and attachment

has_attached_file :upload,
    :storage => :s3,
       :bucket => 'bestofbauer',
       :s3_credentials => {
         :access_key_id => ENV['MyAccessKEY'],
         :secret_access_key => ENV['MySecretKey']
       }

I have a bucket setup with s3 called bestofbauer.

I know I could refactor the credentials into an initializer but I haven’t gotten this to save an attachment yet so I haven’t worried about it.

When I run the save for the object and its attachement I get:

RuntimeError in RecommendationsController#create

Missing credentials

I have poured over: Credentials missing when uploading photos with Paperclip and Amazon s3 but that didn’t resolve my issue.

I am using the following gems:

gem "paperclip"
gem "sws-sdk"
gem 'aws-s3'

Any other ideas?

  • 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-31T04:14:46+00:00Added an answer on May 31, 2026 at 4:14 am

    You need to set your environment variables. Here’s two different ways to do it:

    1. Every time you run rails server or any other command that accesses your S3 account you need to include your keys:

      $ MyAccessKEY=ACCESS_KEY MySecretKEY=SECRET_KEY rails server
      
    2. I’m assuming you’re using bash so edit your ~/.bash_rc or ~/.bash_profile to set your environment variables

      export MyAccessKEY=ACCESS_KEY
      export MySecretKEY=SECRET_KEY
      

      Then open a new terminal window and double-check that they’re set

      $ echo $MyAccessKey
      > ACCESS KEY PRINTS OUT HERE
      

    If you’re deploying to Heroku then you’ll want to provide your environment variables there as well:

    $ heroku config:add MyAccessKEY=ACCESS_KEY MySecretKEY=SECRET_KEY
    

    You can review your Heroku config:

    $ heroku config
    

    It will list out all of the config variables you have for that app.

    You’ll probably want to put your S3 bucket name in an ENV setting as well so you don’t mess up your bucket when testing locally.

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

Sidebar

Related Questions

This should be pretty straightforward I would think. I have this string: [quote=Joe Johnson|1]Hi![/quote]
What I want to do is pretty straightforward. I have a site powered by
Well, I'm gonna be pretty straightforward here, I just have a piece of code
OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward,
I have a pretty straightforward Excel spreadsheet, and I need to use the data
So pretty straightforward question. I have a c# .dll with a whole lot of
Situation is pretty straightforward. I have a Java webapp that I'm converting to be
I have a model which allows users to upload an .ics file to a
This should have been pretty straightforward using the DOM but I seem to be
I have a side project I do = in Java. It's a pretty straight-forward

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.