2016-11-30 145 views
1

我在通过回形针上传文件后在heroku上出现以下错误。AWS :: S3 :: Errors :: Heroku上的PermanentRedirect

AWS :: S3 ::错误:: PermanentRedirect(您试图访问 桶必须使用指定的端点解决。请把所有 将来请求该端点)。

这是我在这工作的发展和店铺形象S3的模型

has_attached_file :profile_image, 
:styles => { :myrecipes => "260x180#"}, 
:storage => :s3, 
:s3_region => 'us-west-1', 
:s3_credentials => "#{Rails.root}/config/amazon_s3.yml", 
:path => "/images/:id/:style.:extension", 
:url => ":s3_domain_url" 

设置,但同时我想对生产(Heroku的)我收到提示。

回答

1

提供您所要做添加这个端点到您的paperclip_defaults

:s3_host_name => "s3-eu-west-1.amazonaws.com" 

或者你可以像这样

s3_host_name: "s3-#{ENV['AWS_REGION']}.amazonaws.com" 

编号:paperclip issue

+0

仍然得到同样的错误。 –

+0

将':url =>“:s3_domain_url”'更改为':url =>“:s3_host_name”' –

相关问题