views:

152

answers:

1

Hello everybody,

I m trying to upload a file through attachment fu to amazon s3 storage using the following code :-

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

But get the following error:-

Connection refused - connect(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'
A: 

like ruby is stating you cannot connect to the s3 server for some reason.

make some connectivity test on your server using the telnet command.

i.e. telnet s3.amazonaws.com 80

RageZ