Linus Linus - 1 year ago 73
Ruby Question

Upload files to AWS S3 with plain Ruby

I'm trying to list the files in the bucket named

on S3 using the
gem. This is my code:

require require 'aws-sdk'

region: 'Ireland',
credentials:, key2)

s3 =
print s3.list_buckets

This is the (important part of the) error I get:

/Users/user/.rbenv/versions/2.2.3/lib/ruby/2.2.0/net/http.rb:879:in `initialize': unable to connect to ``; SocketError: getaddrinfo: nodename nor servname provided, or not known (Seahorse::Client::NetworkingError)

What am I missing? Thanks!

Answer Source

Your region name is incorrect. While that region is colloquially known as Ireland, the API name is eu-west-1. There is a full list of regions here