Paperclip似乎无法连接到我的amazon s3存储桶实例,它会出现此错误 -
*** Exception Errno::ECONNREFUSED in Rack application object (Connection refused - connect(2) for "bucket-images-test.s3.amazonaws.com" port 443)
我的production.rb看起来像这样:
config.paperclip_defaults = {
:storage => :s3,
:s3_credentials => {
:bucket => 'bucket-images',
:access_key_id => 'accesskey',
:secret_access_key => 'seceretkey',
:host_name => 's3-website-us-east-1'
},
:default_url => "/missing.png",
:path => "/:attachment/:id/:style/:filename",
:url => "/:attachment/:id/:style/:filename"
}
我正在使用:
答案 0 :(得分:1)
问题在于宝石和iptables 的Gemfile
gem 'paperclip', '~> 4.2.0'
gem 'aws-sdk', '~> 1.5.8'
gem 'aws-sdk-resources '~> 2'
我也阻止了端口443所以我不得不改变iptables:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp spt:http
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http