AWS S3桶终端失败

AWS S3 Bucket Endpoint Failing

I am building a web app in Rails 5, Ruby 2.4.0 and using the AWS-SDK Gem along with Shrine gem.

Currently I get this error message when I try to upload an image to my AWS Bucket.

I have verified my region here: http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

enter image description here

My shrine.rb file:

 require "shrine"
require "shrine/storage/s3"
require "image_processing/mini_magick"

s3_options = {
    :access_key_id =>       ENV["AWS_ACCESS_KEY_ID"],
    :secret_access_key =>   ENV["AWS_SECRET_KEY"],
    :region =>              'ca-central-1',
    :bucket =>              ENV["AWS_BUCKET"],
}

Shrine.storages = {
    cache: Shrine::Storage::S3.new(prefix: "cache", **s3_options),
    store: Shrine::Storage::S3.new(prefix: "store", **s3_options),
}

I hardcoded in the region to see if it was perhaps the an issue with my ENV. but i get the same results.

I am stuck with how to proceed on this, as every time I try to set an endpoint for my region shrine screams and says its an invalid config.

Any assistance here would be greatly appreciated!

This issue was reported in shrine#163, and the issue seems to be resolved with specifying the :endpoint:

require "shrine"
require "shrine/storage/s3"
require "image_processing/mini_magick"

s3_options = {
  :access_key_id =>       ENV["AWS_ACCESS_KEY_ID"],
  :secret_access_key =>   ENV["AWS_SECRET_KEY"],
  :region =>              'ca-central-1',
  :bucket =>              ENV["AWS_BUCKET"],
  :endpoint =>            ENV["AWS_ENDPOINT"] # <=======
}

Shrine.storages = {
  cache: Shrine::Storage::S3.new(prefix: "cache", **s3_options),
  store: Shrine::Storage::S3.new(prefix: "store", **s3_options),
}
Thanks for the reply, I had opened an issue on github but found the solution in 163 I forgot to close this question.

Add another param:

:s3_host_name => s3.ca-central-1.amazonaws.com
shrine gem wont allow another param, It crashed out.. Im Using Paperclip now, but still having same issue