0

After upload image on S3 I get invalid url.

https://s3.amazonaws.com//uploads/...

My Carrierwave settings

CarrierWave.configure do |config|
  config.fog_credentials = {
      :provider               => 'AWS',
      :aws_access_key_id      => "#{ENV['ACCESS_KEY']}",
      :aws_secret_access_key  => "#{ENV['SECRET_KEY']}",
      :region                 => "#{ENV['REGION']}"
  }
  config.fog_directory  = "#{ENV['BUCKET']}"
end 

This error only production. In development I get valid URL. What is the reason for this?

Andy
  • 863
  • 1
  • 8
  • 20

1 Answers1

2

in the _uploader.rb, check this:

def store_dir
    "uploads/..."
end

Not this:

def store_dir
    "/uploads/..."
end

Watch out for the extra / before uploads.