gpt4 book ai didi

ruby-on-rails - 您尝试访问的存储桶必须使用指定的端点进行寻址

转载 作者:行者123 更新时间:2023-12-04 06:17:34 26 4
gpt4 key购买 nike

我在最新的 rails (4.2.6) 项目中使用了 paperclip 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

有谁知道发生了什么?

谢谢你的帮助,

安东尼

最佳答案

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

关于ruby-on-rails - 您尝试访问的存储桶必须使用指定的端点进行寻址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37763149/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com