I have a bucket on the Amazon S3 with the folder in it. I\'m trying to access it the following way via aws-sdk gem:
s3 = AWS::S3.new(
:
In case anyone is looking for this, here is how it should work according to https://github.com/aws/aws-sdk-ruby
creds = JSON.load(File.read('secrets.json'))
Aws.config[:credentials] = Aws::Credentials.new(creds['AccessKeyId'], creds['SecretAccessKey'])
Aws.config[:region] = 'us-east-1'
client = Aws::S3::Client.new(
region: Aws.config[:region],
credentials: Aws.config[:credentials]
)
File.open('/local_directory/picture.jpg', 'rb') do |file|
client.put_object(bucket: 'bucket', key: 'folder_inside_bucket/picture.jpg', body: file)
end