help a noobie

Greetings All,

I'm in love with Rails. I know allot of these books out are pre 2.0, though I don't think that's what's happening with me. ruby-aaws: installed via gem: wojtek@Mexicalli:~$ gem list

*** LOCAL GEMS ***

actionmailer (2.3.4) actionpack (2.3.4) activerecord (2.3.4) activeresource (2.3.4) activesupport (2.3.4) amazon-ec2 (0.7.3) builder (2.1.2) highline (1.5.1) hoe (2.3.3) json_pure (1.2.0) mime-types (1.16) mysql (2.8.1) rack (1.0.1) rails (2.3.4) rake (0.8.7) ruby-aaws (0.7.0) ruby-aws (1.2.0) rubyforge (2.0.3) xml-simple (1.0.12)

Right there, ruby-aaws. Now, I think my problem is in passing the key's on the call. I understand that my Amazon secret_key_id is to be store @ ~/.amazonrc and I've verified its format and that's good, though irb: Loading development environment (Rails 2.3.4)

require 'amazon/aws/search'

=> ["Amazon"]

include Amazon::AWS

=> Object

  include Amazon::AWS::Search

=> Object'xxxxxxmykeyxxxxxxxx', 'calibanorg-20' )

=> #<Amazon::AWS::Search::Request:0xb71d36cc @locale="us", @key_id="xxxxxxmykeyxxxxxxxx", @conn=nil, @cache=#<Amazon::AWS::Cache: 0xb71d2560 @path="/tmp/amazon">, @user_agent="Ruby/Amazon/AWS 0.7.0", @tag="calibanorg-20", @encoding=nil, @config={}, @api=nil>

is ='Books', {'Keywords' => 'Ruby Programming'})

=> #<Amazon::AWS::ItemSearch:0xb71ca8b0 @response_group=#<Amazon::AWS::ResponseGroup:0xb71ca4dc @params= {"ResponseGroup"=>"Large"}, @list=[:Large]>, @params= {"Operation"=>"ItemSearch", "Keywords"=>"Ruby Programming", "SearchIndex"=>"Books"}, @kind="ItemSearch">

Amazon::AWS::HTTPError: HTTP response code 400   from /var/lib/gems/1.8/gems/ruby-aaws-0.7.0/lib/amazon/aws.rb:170:in `get_page'   from /var/lib/gems/1.8/gems/ruby-aaws-0.7.0/lib/amazon/aws/search.rb: 305:in `search'   from (irb):6

So, I don't get it and I've been at it over a day...would like to finish this book (Ruby on Rails Bible) and know what happened here... The thing I see is that @config={} is nil, making me think that /lib/ amazon/aws.rb:170:in `get_page' wasn't passed the secret_key_id... help!! :slight_smile: ty

Not *remotely* a ruby-aaws expert, but I'd recommend that you either install ruby-debug and drop a 'debugger' line at line 168 of aws.rb or at least try some puts statements. The response body of the request may contain more info to help explain the 400 error code.

--Matt Jones