1. 程式人生 > 實用技巧 >AWS S3 使用 travis 編譯的時候提示錯誤 Aws::S3::Errors::PermanentRedirect

AWS S3 使用 travis 編譯的時候提示錯誤 Aws::S3::Errors::PermanentRedirect

具體的提示錯誤資訊如下:

uploading "asciidoc/js/jquery-3.2.1.min.js" with {:content_type=>"application/javascript"}

/home/travis/.rvm/gems/ruby-2.4.5/gems/aws-sdk-core-2.11.632/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call': The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. (Aws::S3::Errors::PermanentRedirect)


這是因為在我們的配置檔案下 travis 將會把資料儲存到 S3 的 us-east-2 儲存區。

如果你的 S3 儲存沒有設定到正確的儲存區的話,你使用 travis 將資料上傳到 S3 將會提示錯誤。

請參考 https://docs.travis-ci.com/user/deployment/s3/ 官方文件中有關 AWS S3 的配置。

當然你也可以在配置檔案中新增

region: eu-west-2

來指定特定的儲存區。

然後再次編譯,你就發現編譯成功的檔案已經上傳上去了。

https://www.ossez.com/t/aws-s3-travis-aws-permanentredirect/780