1
我在我的最新rails(4.2.6)項目中使用了paperclip 5.0.0.beta2。該應用程序託管在Heroku上。我可以上傳圖片,它似乎存儲在Amazon S3上的存儲桶中。然而,在瀏覽器中的圖像看起來有一個破碎的網址,雖然它的指向亞馬遜S3水桶,網址是:您嘗試訪問的存儲桶必須使用指定的端點尋址
當我在瀏覽器中輸入這個網址,我得到一個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-西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
有沒有人有一個想法,這是怎麼回事?
感謝您的幫助,
安東尼
看看這個鏈接的答案是否有幫助 - http://stackoverflow.com/questions/34156963/the-bucket-you-are-attempting-to-access-must-be-addressed-using -the-specified-en - 謝謝! – user1665376
這是一個解決方法,爲我解決了這個問題:https://github.com/thoughtbot/paperclip/issues/2151 – Toontje