I use paperclip like gem rails and aws-sdk.
config.paperclip_defaults = {
:storage => :s3,
:endpoint => ENV['S3_ENDPOINT'],
:s3_credentials => {
:bucket => ENV['S3_BUCKET_NAME_TEST'],
:access_key_id => ENV['AWS_ACCESS_KEY_ID'],
:secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],
:s3_region => ENV['AWS_REGION'],
:s3_host_name => ENV['S3_HOST_NAME']
}
}
gem 'rails', '~> 5.2'
gem 'paperclip', '~> 6.0'
gem 'aws-sdk', '~> 3.0', '>= 3.0.1'
My problem is:
Paperclip url is: http://s3.amazonaws.com/bucket
Paperclip Expiring url is: http://bucket.s3-aws-region.amazonaws.com
And I getting this error message in heroku console:
Seahorse::Client::NetworkingError (unable to connect to `bucket.s3.{region}.amazonaws.com`; SocketError: getaddrinfo: Name or service not known)
WITH:
gem 'rails', '4.2.0'
gem 'paperclip', '~> 4.3'
gem 'aws-sdk', '< 2.0'
My code works!