2011-07-22 77 views
2

我的模型:問題將照片上傳到亞馬遜S3時使用回形針

has_attached_file :avatar, :styles => { :thumb => "65x65>" }, 
    :storage => :s3, 
    :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", 
    :bucket => "doweet-image", 
    :path => ":attachment/:id/:style.:extension" 

當我的圖片上傳到Amazon S3,並把該上的觀點:

<%= image_tag(current_user.avatar.url(:small))%> 

照片做不顯示,當我複製鏈接src這張照片這是:

http://s3.amazonaws.com/doweet-image/avatars/1/small.jpg?1311356386 

當我去鏈接我到那裏這個錯誤:

This XML file does not appear to have any style information associated with it. The document tree is shown below. 
<Error> 
<Code>AccessDenied</Code> 
<Message>Access Denied</Message> 
<RequestId>152EBFC9033E6633</RequestId> 
<HostId> 
Iw3zWXuCC6JjPAJig+pBVqQbLilN4dmTY4VooVO5CVKCH3O/MN3VDawXbI6Zd5NP 
</HostId> 
</Error> 

回答

2

進入您的S3存儲,並確保您的文件夾具有讀取所有訪問。看起來像是找到圖像,但沒有讀取權限。

如果您使用Mac,我會建議傳輸,但我確定通過Web界面就足夠了。