I am integrating paperclip with S3 bucket in RAILS 5
. I am referring https://coderwall.com/p/vv1iwg/set-up-ruby-on-rails-with-paperclip-5-and-s3-using-aws-sdk-v2.
I have written the following in my development.rb:
config.paperclip_defaults = {
storage: :s3,
s3_region: 'us-west-2',
s3_credentials: {
bucket: 'mybucket',
access_key_id: 'my id',
secret_access_key: 'my secret key'
}
}
I am getting the below error while uploading image:
NameError (uninitialized constant Aws::VERSION):
I am using version 3.0.1 of gem aws-sdk
Instead of downgrading, you can introduce the variable that paperclip is missing in the current version. Adding this file works with aws-sdk 3.0.1 and paperclip 5.1.0, and will probably work until paperclip is updated to accommodate the aws changes.
# config/initializers/aws.rb
Aws::VERSION = Gem.loaded_specs["aws-sdk"].version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With