Trouble with fog and AWS S3

75 views
Skip to first unread message

Nathaniel Barnes

unread,
Jan 18, 2015, 9:43:40 PM1/18/15
to ruby...@googlegroups.com
I'm having trouble with fog and AWS S3.

The docs claim that after running c = Fog::Storage.new({ :provider => "AWS", :aws_access_key_id => ACCESS_KEY, :aws_secret_access_key => SECRET_KEY}), I should be able to run something like c.directories to get a list of the buckets under my S3 account?  All I get is 

 =>   <Fog::Storage::AWS::Directories
    
  > 

I can try to create a new directory with c.directories.create(:key => 'my_new_directory'), but that gives me

ArgumentError: wrong number of arguments (0 for 1)
from /Users/fox/.rvm/gems/ruby-2.1.2/gems/fog-core-1.27.3/lib/fog/formatador.rb:6:in `initialize'
from /Users/fox/.rvm/gems/ruby-2.1.2/gems/fog-core-1.27.3/lib/fog/core/model.rb:24:in `new'
from /Users/fox/.rvm/gems/ruby-2.1.2/gems/fog-core-1.27.3/lib/fog/core/model.rb:24:in `inspect'
from /Users/fox/.rvm/rubies/ruby-2.1.2/bin/irb:11:in `<main>'

Weirdly, if, after getting that error, I go to my S3 dashboard, I can see that I do, in fact, have a new bucket called my_new_directory.  However, I still can't see it's existence with c.directories.

I have similar problems with seeing and creating files.  I can create files under a bucket, but I get the same wrong number of arguments error, but the file is still created.

Does anybody have any idea what I might be doing wrong here? It seems like this is pretty basic stuff that I'm having trouble with, but I can't figure out what I might be doing wrong.

Thanks in advance.

- Nathaniel Barnes

Frederick Cheung

unread,
Jan 19, 2015, 2:10:12 AM1/19/15
to ruby...@googlegroups.com
There are some open issues on this (look for formator on fog-core or fog itself) the issue is the inspect method on subclasses of Fog::Model - the create itself works fine. If you haven't already, check that you have the latest version of fog-core

Fred

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages