我收到此错误:
<Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to access must be addressed using the specifIEd endpoint. Please send all future requests to this endpoint.</Message><Bucket>cb123</Bucket><Endpoint>cb123.s3.amazonaws.com</Endpoint><RequestID>870BC2E8570EF4E7</RequestID><HostID>yuBkeXxftr7O9Ib0SasFTq8Hlvgc7hkhx9VMr+VwRL74qSDgJ9rqMgEU9norIQe/</HostID></Error>
这是我的设置:
has_attached_file :image,styles: { medium: "400x400#",small: "250x250#",:url =>':s3_domain_url',:path => '/:class/:attachment/:ID_partition/:style/:filename' }
谢谢!
解决方法 将其添加到application.rb或每个环境的配置文件中:config.paperclip_defaults = { :storage => :s3,:s3_host_name => 's3-eu-central-1.amazonaws.com',:s3_credentials => { :bucket => 'your bucket',:access_key_ID => 'your access-key-ID',:secret_access_key => 'your secret-access-key' },:path => '/:class/:attachment/:ID_partition/:style/:filename'}
然后,您可以从模型中删除:url和:path config.
总结以上是内存溢出为你收集整理的ruby-on-rails – Rails回形针不显示来自Amazon S3的上传图像全部内容,希望文章能够帮你解决ruby-on-rails – Rails回形针不显示来自Amazon S3的上传图像所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)