title: Connection issues with Amazon S3 Rails 3.1.1 and Windows 7
body: <p>I'm upgrading my rails app using Paperclip and uploading my attachments via ftp (using paperclipftp gem).  I'm currently in my development environment which includes Rails 3.1.1, Ruby ruby 1.9.2p290, paperclip 3.0.4, aws-sdk 1.8.1.2
  I've made changes to my app to utilize the aws-sdk gem to utilize amazon s3 for my attachment storage.  Here's what I have in my Gemfile:</p>
  
  <pre><code>gem 'mysql2'
  gem 'execjs'
  gem 'web-app-theme', '~&gt; 0.8.0'
  gem 'therubyracer', :platforms =&gt; :ruby
  gem 'paperclip', '~&gt; 3.0.0'
  gem 'tinymce-rails'
  gem 'cocaine', '~&gt; 0.3.2'
  gem 'aws-sdk'
  </code></pre>
  
  <p>In my model I define the attachment with:</p>
  
  <pre><code>#paperclip
    has_attached_file :upload,
       :styles =&gt; Proc.new { |attach| attach.instance.attachment_styles },
       :storage =&gt; :s3,
       :s3_credentials =&gt; Rails.root.join('config', 's3.yml'),
       :path =&gt; "/:attachment/:id/:style/:basename.:extension",
       :url =&gt; "http://" + FTP_CONFIG['file_host'] + "/:attachment/:id/:style/:basename.:extension"
  </code></pre>
  
  <p>My s3.yml file looks like:</p>
  
  <pre><code>development:
    bucket: a36-dev
    access_key_id: #########
    secret_access_key: ##########
  
  test:
    bucket: a36-test
    access_key_id: #########
    secret_access_key: #########
  
  production:
    bucket: a36-prod
    access_key_id: #########
    secret_access_key: #########
  </code></pre>
  
  <p>The error I continue to get is:
  Errno::ECONNABORTED in MediaController#create_for_content 
  An established connection was aborted by the software in your host machine</p>
  
  <p>Here's the stack trace:</p>
  
  <pre><code>C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/openssl/buffering.rb:235:in `syswrite'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/openssl/buffering.rb:235:in `do_write'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/openssl/buffering.rb:249:in `write'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/net/protocol.rb:191:in `write0'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/net/protocol.rb:167:in `block in write'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/net/protocol.rb:182:in `writing'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/net/protocol.rb:166:in `write'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/net/http.rb:1756:in `send_request_with_body_stream'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/net/http.rb:1726:in `exec'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/net/http.rb:1189:in `transport_request'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/net/http.rb:1177:in `request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/net/http/connection_pool/session.rb:64:in `request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/net/http/connection_pool.rb:173:in `block in request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/net/http/connection_pool.rb:194:in `session_for'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/net/http/connection_pool.rb:171:in `request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/net/http/connection_pool/connection.rb:173:in `request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/http/net_http_handler.rb:66:in `handle'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/client.rb:230:in `block in make_sync_request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/client.rb:266:in `retry_server_errors'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/client.rb:226:in `make_sync_request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/client.rb:451:in `block (2 levels) in client_request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/client.rb:334:in `log_client_request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/client.rb:420:in `block in client_request'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/client.rb:316:in `return_or_raise'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/core/client.rb:419:in `client_request'
  (eval):3:in `put_object'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/s3/s3_object.rb:1649:in `write_with_put_object'
  vendor/bundle/ruby/1.9.1/gems/aws-sdk-1.8.1.2/lib/aws/s3/s3_object.rb:600:in `write'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/storage/s3.rb:313:in `block in flush_writes'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/storage/s3.rb:299:in `each'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/storage/s3.rb:299:in `flush_writes'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/attachment.rb:200:in `save'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/instance_methods.rb:17:in `block in save_attached_files'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/instance_methods.rb:10:in `block in each_attachment'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/instance_methods.rb:9:in `each'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/instance_methods.rb:9:in `each_attachment'
  vendor/bundle/ruby/1.9.1/gems/paperclip-3.0.4/lib/paperclip/instance_methods.rb:16:in `save_attached_files'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:401:in `_run_save_callbacks'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/callbacks.rb:264:in `create_or_update'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/persistence.rb:37:in `save'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/validations.rb:50:in `save'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/attribute_methods/dirty.rb:22:in `save'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:241:in `block (2 levels) in save'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:208:in `transaction'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:241:in `block in save'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:252:in `rollback_active_record_state!'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/transactions.rb:240:in `save'
  app/controllers/media_controller.rb:207:in `create_for_content'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/abstract_controller/base.rb:167:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:425:in `_run__690981913__process_action__778841897__callbacks'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/abstract_controller/callbacks.rb:17:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/rescue.rb:17:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/notifications.rb:53:in `block in instrument'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/notifications.rb:53:in `instrument'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/params_wrapper.rb:201:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/abstract_controller/base.rb:121:in `process'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/abstract_controller/rendering.rb:45:in `process'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal.rb:193:in `dispatch'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_controller/metal.rb:236:in `block in action'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/routing/route_set.rb:65:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/routing/route_set.rb:29:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'
  vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'
  vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:75:in `optimized_each'
  vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'
  vendor/bundle/ruby/1.9.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/routing/route_set.rb:532:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/etag.rb:23:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/conditionalget.rb:35:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/head.rb:14:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/flash.rb:243:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/session/abstract/id.rb:195:in `context'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/session/abstract/id.rb:190:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/cookies.rb:331:in `call'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/query_cache.rb:62:in `call'
  vendor/bundle/ruby/1.9.1/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/reloader.rb:68:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/sendfile.rb:101:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
  vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/rack/logger.rb:13:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/methodoverride.rb:24:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/runtime.rb:17:in `call'
  vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/lock.rb:15:in `call'
  vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1/lib/action_dispatch/middleware/static.rb:53:in `call'
  vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:456:in `call'
  vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/rack/content_length.rb:16:in `call'
  vendor/bundle/ruby/1.9.1/gems/railties-3.1.1/lib/rails/rack/log_tailer.rb:14:in `call'
  vendor/bundle/ruby/1.9.1/gems/rack-1.3.9/lib/rack/handler/webrick.rb:59:in `service'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
  C:/RailsInstaller/Ruby1.9.2/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
  </code></pre>
  
  <p>I can't figure out why I keep getting this error.  Any help would be greatly appreciated.</p>