Works fine with ruby1.8.7 but fails with ruby2.0.0. All the jpegs downloads complete, then there is an error when downloading info.json.
ruby-2.0.0-p0/gems/aws-2.9.1/lib/awsbase/awsbase.rb:542:in 'block (2 levels) in request_info_impl': KeyTooLongError: Your key is too long (Aws::AwsError)
def download_file( source_path, s3_key )
File.open(source_path,'w') {|f|
@bucket.get(s3_key) do |chunk|
f.write(chunk)
end
}
end
jpegs = @bucket.keys({:prefix => id+"/jpegs"})
jpegs.each do |key|
download_file("tmp.jpg",key)
end
infojson = @bucket.keys({:prefix => id+"/info.json"})
download_file("info.json",infojson)