Error using Refile + AWS SDK

Asked

Viewed 146 times

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 running Rails, 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 (Namroreer)

  • Ruby 2.2.0, Rails 4.2.0

1 answer

0


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

gem 'aws-sdk', '< 2.0'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.