Tag: amazon s3

301 S3上传后永久移动

我试图使用carrierwave和雾gem将图像上传到Ruby on Rails上的S3,正确上传图像但是当我尝试保存包含刚刚上传的图像信息的模型时我得到了这个错误: Excon::Errors::MovedPermanently in UserController#show app/models/user.rb:46:in `process_image_with_key’ app/controllers/user_controller.rb:12:in `show’ <Excon::Response:0x007f97846a3c18 @body="\nPermanentRedirectThe bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. 用户模型: mount_uploader :image, AvatarUploader def image_name File.basename(image.path || image.filename) if image end def process_image_with_key( key ) unless key.nil? self.key = key self.remote_image_url […]