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

The Archive Base Latest Questions

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

In an attempt to install S3 with Heroku, my app has crashed. What I

  • 0

In an attempt to install S3 with Heroku, my app has crashed.

What I want to do is have Carrierwave upload files to the S3 storage, and for rails to load the assets from S3 storage. I opened my S3 account and within my app bucket, I uploaded the entire Assets folder with directory tree ass follow:

  • MyApp
    • assets
      • images
      • javascripts
      • stylesheets

Here are the steps I followed, reading the guide Heroku: Using AWS S3 to Store Static Assets and File Uploads and Example of setting up S3 with Carrierwave:

In my Gemfile I added

gem 'fog'

I ran the commands:

heroku config:add AWS_ACCESS_KEY_ID=XXXXXX AWS_SECRET_ACCESS_KEY=XXXXXX
heroku config:add S3_BUCKET_NAME=myapp
heroku config:add S3_REGION=ap-southeast-1 # I created my bucket in Singapore
heroku config:add S3_ASSET_URL=https://s3-ap-southeast-1.amazonaws.com/myapp/assets_%24folder%24

Then ran the bundle install

Then I created config/initializers/carrierwave.rb

# config/initializers/carrierwave.rb
CarrierWave.configure do |config|
  config.fog_credentials = {
    # Configuration for Amazon S3 should be made available through an Environment variable.
    # For local installations, export the env variable through the shell OR
    # if using Passenger, set an Apache environment variable.
    #
    # In Heroku, follow http://devcenter.heroku.com/articles/config-vars
    #
    # $ heroku config:add S3_KEY=your_s3_access_key S3_SECRET=your_s3_secret S3_REGION=eu-west-1 S3_ASSET_URL=http://assets.example.com/ S3_BUCKET_NAME=s3_bucket/folder
    # Configuration for Amazon S3
    :provider => 'AWS',
    :aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'],
    :aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
    :region => ENV['S3_REGION']
  }

  # For testing, upload files to local `tmp` folder.
  if Rails.env.test? || Rails.env.cucumber?
    config.storage = :file
    config.enable_processing = false
    config.root = "#{Rails.root}/tmp"
  else
    config.storage = :fog
  end

  config.cache_dir = "#{Rails.root}/tmp/uploads" # To let CarrierWave work on heroku
  config.fog_directory = ENV['S3_BUCKET_NAME']
  config.s3_access_policy = :public_read # Generate http:// urls. Defaults to :authenticated_read (https://)
  config.fog_host = "#{ENV['S3_ASSET_URL']}/#{ENV['S3_BUCKET_NAME']}"

end

Afterwhich I updated my git and pushed on heroku:

git add .
git commit -m "added S3 configs with fog"
git push heroku master

When I went on my Heroku app, I realized that there is an error and I checked my logs with the following errors:

...
2013-01-20T11:00:17+00:00 heroku[web.1]: Process exited with status 1
2013-01-20T11:00:17+00:00 heroku[web.1]: State changed from starting to crashed
2013-01-20T11:00:17+00:00 heroku[web.1]: State changed from crashed to starting
...
2013-01-20T11:00:52+00:00 app[web.1]: /app/config/initializers/carrierwave.rb:29:in `block in <top (required)>': undefined method `s3_access_policy=' for CarrierWave::Uploader::Base:Class (NoMethodError)
...
2013-01-20T11:00:53+00:00 heroku[web.1]: Process exited with status 1
2013-01-20T11:00:53+00:00 heroku[web.1]: State changed from starting to crashed
2013-01-20T11:04:52+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=myapp.herokuapp.com fwd=xxx.xxx.xx.x dyno= queue= wait= connect= service= status=503 bytes=
2013-01-20T11:04:54+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=myapp.herokuapp.com fwd=xxx.xxx.xx.x dyno= queue= wait= connect= service= status=503 bytes=
2013-01-20T11:04:55+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=myapp.herokuapp.com fwd=xxx.xxx.xx.x dyno= queue= wait= connect= service= status=503 bytes=

I also tried to run the heroku run rake db:migrate

and got an error:

rake aborted!
undefined method `s3_access_policy=' for CarrierWave::Uploader::Base:Class

Also, in my views, what URL should I put for the static assets?

Thank you for any wise advice

Aurelien

  • 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:01:48+00:00Added an answer on June 18, 2026 at 4:01 am

    I am not sure for this, but I seem to have followed the same guide as you, and it must be outdated. The CarrierWave Uploader API seems to have changed. Now, uploaded images are public by default, which you can change via the config.fog_public configuration option.

    Look here and here for more info.

    I ended up with only:

    ...
    :provider              => 'AWS',
    :aws_access_key_id     => ENV['S3_KEY'],
    :aws_secret_access_key => ENV['S3_SECRET'],
    :region                => ENV['S3_REGION']
    ...
    

    In my fog initializer. Nothing more was needed.

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

Sidebar

Related Questions

Rails and all my gem files + homebrew installs have been working fine up
For my Heroku app (Rails 3.1.4 and Ruby 1.9.2), I'm trying to change to
For some reason, every time I attempt to install a new module using easy_install,
When pushing a new app to heroku, then running heroku rake db:migrate I get
When I attempt to install Microsoft Visual C++ 2010 Redistributable I get the following
I am attempting to install phpBugTracker on our web server. When I attempt to
I have OS X 10.6.6 Snow Leopard. The OS X default install of python
When I attempt to install eclipse, I recieve an error stating that Eclipse cannot
When I attempt to install Visual Studio 2012 I am presented with this error:
I have the unable to install blah blah.....Unity 2.0.414.0 must be installed into the

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.