Error when using Refile + AWS SDK

0
gem "mini_magick"
gem "refile", require: ["refile/rails", "refile/image_processing"]
gem "aws-sdk"

My config / initializers / refile.rb file

require "refile/backend/s3"

aws = {
  access_key_id: ENV['S3_ACCESS_KEY'],
  secret_access_key: ENV['S3_SECRET_ACCESS_KEY'],
  bucket: ENV['S3_BUCKET'],
}
Refile.cache = Refile::Backend::S3.new(prefix: "cache", **aws)
Refile.store = Refile::Backend::S3.new(prefix: "store", **aws)

When I run rails, it shows this error:

/usr/local/Cellar/ruby/2.2.0/lib/ruby/gems/2.2.0/gems/refile-0.4.2/lib/refile/backend/s3.rb:14:in 'initialize' : uninitialized constant Refile :: Backend :: S3 :: AWS (NameError)

    
asked by anonymous 16.02.2015 / 17:16

1 answer

0

I was having the same error, I put the aws-sdk version in gemfile and it worked:

gem 'aws-sdk', '< 2.0'
    
16.02.2015 / 20:39