title: Is there a way to download a file from s3 using the ruby gem aws-s3?
body: <p>Ok so i tried two methods both failed</p>
  
  <p>First method using the <a href="http://amazon.rubyforge.org/" rel="nofollow">aws-s3</a> gem </p>
  
  <pre><code>require 'aws/s3'
  S3ID = "MYACCESS"
  S3KEY = "MYKEY"
  include AWS::S3
  AWS::S3::Base.establish_connection!(
    :access_key_id     =&gt; S3ID,
    :secret_access_key =&gt; S3KEY
  )
  
  bucket = AWS::S3::Bucket.find("test_bucket")
   =&gt; #&lt;AWS::S3::Bucket:0x007fea3e2898c8 @attributes={"xmlns"=&gt;"http://s3.amazonaws.com/doc/2006-03-01/", "name"=&gt;"test_bucket", "prefix"=&gt;nil, "marker"=&gt;nil, "max_keys"=&gt;1000, "is_truncated"=&gt;true}, @object_cache=[#&lt;AWS::S3::S3Object:0x70322020960960 '/test_bucket/00000188110119_1000000731213/'&gt;, #&lt;AWS::S3::S3Object:0x70322020960660 '/test_bucket/00000188110119_1000000731213/10_08-52-08.mp3'&gt;, #&lt;AWS::S3::S3Object:0x703220209
  
  bucket.size
   =&gt; 1000 
  
  bucket.objects[0]
   =&gt; #&lt;AWS::S3::S3Object:0x70322028046080 '/test_bucket/00000188110119_1000000731213/'&gt; 
  bucket.objects[1]
   =&gt; #&lt;AWS::S3::S3Object:0x70322028046040 '/test_bucket/00000188110119_1000000731213/10_08-52-08.mp3'&gt; 
  bucket.objects[1].key
   =&gt; "00000188110119_1000000731213/10_08-52-08.mp3" 
  
  File.open("/Users/matt/local_copy.mp3", "w") do |f|
    f.write(bucket.objects[1])
  end
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>bucket.objects[1]
   =&gt; #&lt;AWS::S3::S3Object:0x70322028046040 '/test_bucket/00000188110119_1000000731213/10_08-52-08.mp3'&gt; 
  bucket.objects[1].read
   NoMethodError: undefined method `read' for #&lt;AWS::S3::S3Object:0x70322028046040&gt;
  bucket.objects[1].class
   =&gt; AWS::S3::S3Object 
  </code></pre>
  
  <p>As you can see what i am trying to do is copy the mp3 from the s3 bucket and copy it to the local computer....any ideas on how to do this</p>