简体   繁体   中英

Error Uploading to Heroku (AWS)

I am trying to get AWS setup so I can use that to store images for my rails app. The problem I am getting the following error when I try to push to Heroku:

ArgumentError:  is not a recognized provider

Here is my carrierwave.rb code:

if Rails.env.production?
  CarrierWave.configure do |config|
    config.fog_credentials = {
      :provider => 'AWS',
      :aws_access_key_id => ENV['S3_ACCESS_KEY'],
      :aws_secret_access_key => ENV['S3_SECRET_KEY']
    }

    config.fog_credentials = ['S3_BUCKET']

  end
end

Here is code from picture_uploader.rb file

if Rails.env.production?
  storage :fog
else
  storage :file
end

And finally this is my heroku config

DATABASE_URL:             postgres://<url>
LANG:                     en_US.UTF-8
RACK_ENV:                 production
RAILS_ENV:                production
RAILS_SERVE_STATIC_FILES: enabled
S3_ACCESS_KEY:            <access_key>
S3_BUCKET:                <bucket_name>
S3_SECRET_KEY:            <secret_key>
SECRET_KEY_BASE:          <key>

I'm missing something, but I just can't find it.

As soon as I posted this I saw the problem. Typo in the carrierwave.rb file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM