【问题标题】:The bucket you are attempting to access must be addressed using the specified endpoint您尝试访问的存储桶必须使用指定的端点进行寻址
【发布时间】:2016-10-12 07:14:28
【问题描述】:

我在最新的 rails (4.2.6) 项目中使用回形针 5.0.0.beta2。该应用程序托管在 Heroku 上。我可以上传一张图片,它似乎存储在 Amazon S3 上的存储桶中。然而,在浏览器中,图像似乎有一个损坏的 url,虽然它指向 Amazon S3 上的存储桶,但 url 是:

http://s3.amazonaws.com/gigbnb/profiles/profile_pics/000/000/002/small/anthony_candaele-300x300.jpg?1464956858

当我在浏览器中输入这个 url 时,我得到一个带有这个错误消息的 xml 页面:

The bucket you are attempting to access must be addressed using the     specified endpoint. Please send all future requests to this endpoint.

S3 端点似乎存在问题。

但是我在配置文件中设置了区域(eu-west-1):

config/environments/production.rb


config.paperclip_defaults = {
   storage: :s3,
   s3_region: ENV.fetch('AWS_REGION'),
   s3_credentials: {
     bucket: ENV.fetch('S3_BUCKET_NAME'),
     access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
     secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
   }
}

我的 Github 存储库位于:

https://github.com/acandael/gigbnb

有人知道发生了什么吗?

感谢您的帮助,

安东尼

【问题讨论】:

标签: ruby-on-rails paperclip


【解决方案1】:

这是一个workaround,它为我解决了这个问题。由 aminariana 提出

【讨论】:

    猜你喜欢
    • 2022-12-01
    • 1970-01-01
    • 2016-05-05
    • 2016-03-13
    • 2021-03-29
    • 2016-06-01
    • 2021-04-09
    • 2018-09-14
    相关资源
    最近更新 更多