I am trying to use the new S3 library (thanks Marcel!) but I am getting an Uninitialized Constant message: >> Service.buckets NameError: uninitialized constant Service from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/ lib/active_support/dependencies.rb:100:in `const_missing_not_from_s3_library'' from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.1.1/lib/aws/ s3/extensions.rb:119:in `const_missing'' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/ lib/active_support/dependencies.rb:131:in `const_missing'' from (irb):2 I am calling the following in my environment.rb file: require ''aws/s3'' AWS::S3::Base.establish_connection!(:access_key_id => MY_ID_HERE, :secret_access_key => MY_KEY_HERE) and then I fired up the console and tried the above and boom... I also tried not putting the connection call in environment.rb and instead into a controller. Same deal. I recently upgraded to the new gem: aws-s3 (0.1.1, 0.1.0) Client library for Amazon''s Simple Storage Service''s REST API Any ideas what I am doing wrong? I can run the command line client included in the gem without difficulty. Thanks a ton, Hunter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hunter Hillegas wrote:> I am trying to use the new S3 library (thanks Marcel!) but I am > getting an Uninitialized Constant message: > > >> Service.buckets > NameError: uninitialized constant Service > from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/ > lib/active_support/dependencies.rb:100:in > `const_missing_not_from_s3_library'' > from /opt/local/lib/ruby/gems/1.8/gems/aws-s3-0.1.1/lib/aws/ > s3/extensions.rb:119:in `const_missing'' > from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/ > lib/active_support/dependencies.rb:131:in `const_missing'' > from (irb):2 > > I am calling the following in my environment.rb file: > > require ''aws/s3'' > AWS::S3::Base.establish_connection!(:access_key_id => > MY_ID_HERE, :secret_access_key => MY_KEY_HERE) > > and then I fired up the console and tried the above and boom... > > I also tried not putting the connection call in environment.rb and > instead into a controller. Same deal. > > I recently upgraded to the new gem: > > aws-s3 (0.1.1, 0.1.0) > Client library for Amazon''s Simple Storage Service''s REST API > > Any ideas what I am doing wrong? I can run the command line client > included in the gem without difficulty. > > Thanks a ton, > HunterThat is because Service is not accessible globally. add the below line include AWS::S3 or access Service through AWS::S3.Service that should work. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.