I’m using the typical Mac/Ruby 1.9.3p125
irb>
require 'aws/s3'
AWS::S3::Base.establish_connection!(:access_key_id => 'AccessKey',:secret_access_key => 'SecretKey' )
Service.buckets
(Same error with Bucket.find or almost anything!)
Gives me:
NameError: uninitialized constant Service
from ~/.rvm/gems/ruby-1.9.3-p125/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206
:in `const_missing_from_s3_library'
from (irb):23
from ~/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `<main>'
I’m following documentation almost to spec but I’m so confused as to why this is happening?
You need to either include AWS::S3 in your class or do AWS::S3.Service.
Here’s some code samples:
or