2015-04-01 129 views
1

回形針似乎無法連接到我的亞馬遜s3存儲桶實例,它會出現此錯誤 -狀態碼500回形針亞馬遜s3連接被拒絕 - (拒絕連接 - 連接(2)「bucket.s3.amazonaws.com」端口443

*** 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" 
    } 

我使用:

  • 回形針版本4.2.0
  • AWS-SDK版本1.63
  • AWS-SDK-資源版本2
+0

不應':url'設置爲'「:s3_domain_url」'? – ydaetskcoR 2015-04-01 17:43:42

+0

你說的是老s3寶石 – enovacreations 2015-04-01 18:05:18

回答

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 
相關問題