Carrierwave Gem Configuration - Heroku - Fog Gem - Gives a Name Error

I got a little lost with Heroku and Carrierwave Gem. I read WIKI, read me and searched the net, and I admit I need help. Everything is fine locally, but Heroku suppresses the app.

/// ERROR MESSAGE FROM HEROKUS LOGS

2012-01-03T17:33:26+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/carrierwave-0.5.8/lib/carrierwave/uploader/configuration.rb:91:in `eval': uninitialized constant CarrierWave::Storage::Fog (NameError 

/// GEM FILE

 gem "fog" gem 'carrierwave' 

/app/uploaders/avatar_uploader.rb

 storage :fog 

/config/initializers/carrierwave.rb

 CarrierWave.configure do |config| config.fog_credentials = { :provider => 'AWS', :aws_access_key_id => 'XXXX', :aws_secret_access_key => 'XXXX', :region => 'eu-west-1' # optional, defaults to 'us-east-1' } config.fog_directory = 'site_images' # required config.fog_public = true # optional, defaults to true config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {} end 

When I change the storage to a file, not fog, I get no errors. Are there any other fog settings that I skip or skip. Any help is greatly appreciated. Do I need to create a separate document with fog settings?

+6
source share
1 answer

This may not be the solution to your problem, but try adding

config.cache_dir = "#{Rails.root}/tmp/uploads" . This will help to save the files until they are loaded into your S3 basket.

If this does not help, can you also publish your bootloader file?

0
source

Source: https://habr.com/ru/post/905009/


All Articles