CarrierWave / Fog / S3 - "Not a recognized storage vendor"
Using Heroku in production, I have image uploads working fine, rendering thin views. Although, now I am trying to print the filename as part of the url and return the error Is not a recognized storage provider
to the code 'LOGO' => "https://wifiuploads.s3.amazonaws.com/uploads/user/logourl/#{user.id}/#{user.logourl.file.filename}",
- my presumption is that it is present user.logourl.file.filename
since this is the image upload column in my user model. All I am trying to do is print the filename in the url.
My s3.rb config:
CarrierWave.configure do |config|
config.fog_credentials = {
:provider => 'aws',
:aws_access_key_id => ENV['S3_KEY'],
:aws_secret_access_key => ENV['S3_SECRET'],
:region => ENV['S3_REGION']
}
config.fog_directory = ENV['S3_BUCKET']
end
My loaders / image_uploader.rb
# encoding: utf-8
class ImageUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
# storage :file
storage :fog
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
Gems need to be updated as I haven't specified a specific version. The gems are as follows:
gem "carrierwave" #image receiving
gem "mini_magick" #image processing
gem "fog" #s3 integration
Any thoughts? Let me know if there is any other information I need to provide.
source to share
No one has answered this question yet
Check out similar questions: