atonalwilson Posted January 23, 2023 Share Posted January 23, 2023 I am trying to delete uploaded image files with the AWS-SDK-Core Ruby Gem. This check-box appears when you first create your bucket, so if you missed it, head to the S3 dashboard, click on your bucket and go to the permissions tab. Scroll down until you find the section shown above, click edit, uncheck the box, and hit the save button. All these problems were discussed in the aws online training. I have the following code: require 'aws-sdk-core' def pull_picture(picture) Aws.config = { :access_key_id => ENV["AWS_ACCESS_KEY_ID"], :secret_access_key => ENV["AWS_SECRET_ACCESS_KEY"], :region => 'us-west-2' } s3 = Aws::S3::Client.new test = s3.get_object( :bucket => ENV["AWS_S3_BUCKET"], :key => picture.image_url.split('/')[-2], ) end However, I am getting the following error: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. I know the region is correct because if I change it to us-east-1, the following error shows up: The specified key does not exist. What am I doing wrong here? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.