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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:57:47+00:00 2026-06-18T04:57:47+00:00

I have gone through the railscast and researched here on Stack Overflow. Although I

  • 0

I have gone through the railscast and researched here on Stack Overflow. Although I have found others with the same issue, it doesn’t appear that any of the other solutions I have researched seem to work. I have tried multiple variations of the code as suggested in other posts… No luck.

I am attempting to upload and store PDF files to Amazon S3 via the Carrierwave and Fog gems to no avail. While I am using Heroku in production, I have not attempted to deploy this to Heroku yet since I cannot even get this to work locally. The error returned is

Missing required arguments: aws_access_key_id, aws_secret_access_key

How can I fix this problem?

carrierwave.rb (initializer)

CarrierWave.configure do |config|
    config.fog_credentials = {
        provider: 'AWS',
        aws_access_key_id: ENV['MY_KEY_ID'],
        aws_secret_access_key: ENV['MY_KEY']
    }

    config.fog_directory  = ENV['MY_BUCKET']
    config.fog_public     = false
end

pdf_uploader.rb:

class PdfUploader < CarrierWave::Uploader::Base
    storage :fog

    include CarrierWave::MimeTypes
    process :set_content_type

    def store_dir
        "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end
end
  • 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-06-18T04:57:48+00:00Added an answer on June 18, 2026 at 4:57 am

    It looks like there was an issue with setting the key_id, key AND bucket as environmental variables. Once I changed all three to string constants, it seemed to work fine. I also deployed to Heroku and verified functionality in production as well.

    the final initializer file:

    CarrierWave.configure do |config|
        config.storage = :fog
        config.fog_credentials = {
            provider: 'AWS',
            aws_access_key_id: 'MY_KEY_ID_HERE',
            aws_secret_access_key: 'MY_KEY_HERE'
        }
    
        config.fog_directory  = 'MY_S3_BUCKET_HERE'
        config.fog_public     = false
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have gone through Google and Stack Overflow search, but nowhere I was able
I have gone through each of the solutions I've found on here, and still
I have gone through many posts on SO regarding this issue: Tried everything in
Have gone through similar questions here, but have not been able to get this
I have gone through following links enter link description here enter link description here
First of all, I have gone through all the questions here regarding the inclusion
I have gone through the previous thread on the same topic After reading that
I have gone through a bunch of question posts, and found one person with
I have gone through most of the code here and tried several ways to
I have gone through several Q&A here and on different portals but cannot get

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.