2009-11-18 76 views
0

餘米嘗試使用下面的代碼上傳通過附件福到Amazon S3存儲文件: -拒絕連接到S3存儲

has_attachment :storage => :s3, 
       :content_type => 
['audio/mp3','audio/flac','audio/wav'], 
       :path_prefix => '#####', 
       :output_path => '######', 
       :processor => :none 

但得到以下錯誤: -

拒絕連接 - 連接(2)

Application Trace | Framework Trace | Full Trace 
/usr/lib/ruby/1.8/net/http.rb:560:in `initialize' 
/usr/lib/ruby/1.8/net/http.rb:560:in `open' 
/usr/lib/ruby/1.8/net/http.rb:560:in `connect' 
/usr/lib/ruby/1.8/timeout.rb:53:in `timeout' 
/usr/lib/ruby/1.8/timeout.rb:93:in `timeout' 
/usr/lib/ruby/1.8/net/http.rb:560:in `connect' 
/usr/lib/ruby/1.8/net/http.rb:553:in `do_start' 
/usr/lib/ruby/1.8/net/http.rb:542:in `start' 
vendor/plugins/aws-s3/lib/aws/s3/connection.rb:52:in `request' 
vendor/plugins/aws-s3/lib/aws/s3/base.rb:69:in `request' 
vendor/plugins/aws-s3/lib/aws/s3/base.rb:88:in `put' 
vendor/plugins/aws-s3/lib/aws/s3/object.rb:241:in `store' 
vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb:294:in `save_to_storage' 
vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:369:in `after_process_attachment' 
vendor/rails/activerecord/lib/active_record/callbacks.rb:307:in `send' 
vendor/rails/activerecord/lib/active_record/callbacks.rb:307:in `callback' 
vendor/rails/activerecord/lib/active_record/callbacks.rb:304:in `each' 
vendor/rails/activerecord/lib/active_record/callbacks.rb:304:in `callback' 
vendor/rails/activerecord/lib/active_record/callbacks.rb:214:in `create_or_update' 
vendor/rails/activerecord/lib/active_record/base.rb:1973:in `save_without_validation' 
vendor/rails/activerecord/lib/active_record/validations.rb:927:in `save_without_transactions' 
vendor/rails/activerecord/lib/active_record/transactions.rb:108:in `save' 
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction' 
vendor/rails/activerecord/lib/active_record/transactions.rb:80:in `transaction' 
vendor/rails/activerecord/lib/active_record/transactions.rb:100:in `transaction' 
vendor/rails/activerecord/lib/active_record/transactions.rb:108:in `save' 
vendor/rails/activerecord/lib/active_record/transactions.rb:120:in `rollback_active_record_state!' 
vendor/rails/activerecord/lib/active_record/transactions.rb:108:in `save' 
vendor/rails/activerecord/lib/active_record/base.rb:2035:in `update_attributes' 
app/models/track_file.rb:45:in `upload' 
app/controllers/media_controller.rb:202:in `track_update' 
app/controllers/application.rb:157:in `access_session_value_in_models' 

回答

0

像ruby說明你無法連接到s3服務器出於某種原因。

使用telnet命令在您的服務器上進行一些連接測試。

telnet s3.amazonaws.com 80