पर एक फ़ाइल अपलोड करना मैं एक फाइल अपलोड करने की कोशिश कर रहा हूं। एक सरल हैलो.txt। मैं दस्तावेज़ों का पालन कर रहा था, और मैं इसे अपनी बाल्टी में अपलोड करने में असमर्थ हूं।रूबी एसडीके का उपयोग करके अमेज़ॅन एस 3
# START AWS CLIENT
s3 = Aws::S3::Resource.new
bucket = s3.bucket(BUCKET_NAME)
begin
s3.buckets[BUCKET_NAME].objects[KEY].write(:file => FILE_NAME)
puts "Uploading file #{FILE_NAME} to bucket #{BUCKET_NAME}."
bucket.objects.each do |obj|
puts "#{obj.key} => #{obj.etag}"
end
rescue Aws::S3::Errors::ServiceError
# rescues all errors returned by Amazon Simple Storage Service
end
मैं पीछा कर रहा था http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpRuby.html
त्रुटि:
➜ s3-tester ruby main.rb /Users/.rvm/gems/ruby-2.1.1/gems/aws-sdk-resources-2.0.34/lib/aws-sdk-resources/collection.rb:79:in 'method_missing: undefined method []' for '
<Aws::Resources::Collection:0x000001031e5100>
(NoMethodError)' from 'main.rb:18:in<main>
'
क्या मुद्दा है चलाकर my_bucket को simple.txt अपलोड कर सकते हैं upload.rb को बचाया? –
मुझे एक [] कोई विधि त्रुटि नहीं मिली –
ठीक है ... प्रश्न में त्रुटि डालें। –