0
votes

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!

1
bucket.s3.{region}.amazonaws.com I am sure {region} is typo in your codeImre Raudsepp
I not have '{region}' in my code. I have s3_host_name: 's3.amazonaws.com' and region: eu-east-1Beniamin Marcu

1 Answers

0
votes

If you are using us-east region you need not define region in your core. Your by default url will be s3.amazonaws.com for us-east region