Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NameError: uninitialized constant CarrierWave::Storage::Fog in Heroku Logs

Hello i just added AWS S3 Bucket to my app.

Here is the app error https://dry-atoll-6663.herokuapp.com/

In heroku logs when i $heroku restart this error appears

2015-04-28T09:13:15.009823+00:00 app[web.1]: [3] ! Unable to load application: NameError: uninitialized constant CarrierWave::Storage::Fog

My Carrierwave.rb

CarrierWave.configure do |config|
config.fog_credentials = {
  # Configuration for Amazon S3
  :provider              => 'AWS',
  :aws_access_key_id     => ENV['S3_ACCESS_KEY'],
  :aws_secret_access_key => ENV['S3_SECRET_KEY']
}
config.fog_directory     =  ENV['S3_BUCKET']
end

Any ideas? Me and my friend are scratching our heads big time...

like image 774
joeyk16 Avatar asked Feb 10 '23 07:02

joeyk16


1 Answers

Credit @Marcus for correctly answering this in the comments.

In your config/initializers/carrierwave.rb file, you will need to update

CarrierWave.configure do |config|
  # This is the old way, and broken
  config.storage = :fog

into

CarrierWave.configure do |config|
  # This is the new way!
  config.fog_provider = 'fog/aws'

see the carrierwave github for more information.

like image 137
Ben Roux Avatar answered Apr 08 '23 23:04

Ben Roux