Missing required :bucket option; Did Paperclip change up the configuration options?

I’m having odd issues with Paperclip I never experienced before that’s efffecting multiple projects that merely had gem 'paperclip.

I usually have the following defined within my development.rb and production.rb regarding s3 and Paperclip:


 config.paperclip_defaults = {
    :storage => :s3,
    :s3_credentials => {
      :bucket => ENV['AWS_BUCKET_NAME'],
      :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
      :secret_access_key => ENV['AWS_SECRET_ACCESSS_KEY']
    } 
  }

The environment variables in both my heroku config seetings and `env.rb are the following:


ENV['AWS_BUCKET_NAME'] ='app_name'
ENV['AWS_BUCKET'] = 'app-name'
# Other keys omitted' ENV[:AWS_SECRET_ACCESS_KEY], ENV[:AWS_ACCESS_KEY_ID]


I have no idea what’s seems to be the problem. I tried switching bucket name to go with paperclip instead of :s3_credentials with no luck Paperclip with these settings work perfectly fine, making it very confusing what is going on.

Hi @kevinlozandier, the :bucket options does not go under :s3_credentials, it just goes under the root of the options, like this:

config.paperclip_defaults = {
    :storage => :s3,
    :bucket => ENV['AWS_BUCKET_NAME'],
    :s3_credentials => {
      :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
      :secret_access_key => ENV['AWS_SECRET_ACCESSS_KEY']
    } 
  }

The documentation for this is here: Module: Paperclip::Storage::S3 — Documentation for thoughtbot/paperclip (main)

Please let me know if that doesn’t work.

thanks,
-Chad

That’s what I thought as well, but it turned out to also not work; Strangely enough, my next guess a few minutes ago was to see if the folder was respecting the heroku config:set AWS_BUCKET_NAME=xxxxx decelerations and so on, and it seems it isn’t, with or without quoations.

Aware you can set the variables through the command line and EXPORT them, it’s a pand on Windows so I created the aws.yaml and used the figaro gem to set the environments in application.yaml inside the config folder.

Never having to take these extra steps before, I’m up and running w/ Paperclip again; thanks.