I first had trouble figuring out that I needed to put my AWS "secret" key in ~/.amazonrc.

I was getting UTF-8 errors, too. I think adding this to my ~/.amazonrc fixed the problem:

encoding = 'UTF-8'

Hmmm. I guess using the cache also causes UTF-8 related errors.

UPDATE: Finally, late last night I figured it out. The example aaws code I was basing my tests on uses ItemLookup.

ItemLookup has an item_lookup_response object. When I switched to searching, item_lookup_response is not there. I eventually switched to item_search_response, but had cleared out the rest of the example for debugging. Adding it back in returned the right set.

The way the secret key is handled seems odd. Maybe there is a better way? The ruby-aaws RDoc says its the only way though.

UPDATE: There are different ways to set where the amazonrc file is. In my case, running unicorn via daemontools caused ENV['HOME'] to be nil, resulting in amazon.rb trying to evaluate ENV['HOMEDRIVE'] + ENV['HOMEPATH'], causing a NoMethodError that was very difficult to decipher (running unicorn with the "-d" option after invoking the Ruby interpreter helped track down the cause).

I had tried setting $AMAZONRCFILE at first, then $AMAZONRCDIR, but that didn't work I noticed in amazon.rb that it was looking for ENV['AMAZONRCDIR'], so I set it in config.ru and voila - functionality!!

UPDATE:

I've send Ian an email:

Hi Ian,

Nice work on the ruby-aaws gem. I'm using it with Sinatra and Unicorn,
which is run by daemontools. For whatever reason, ENV['HOME'] was
resulting in nil, causing it to try ENV['HOMEDRIVE'] + ENV['HOMEPATH'],
which for me resulted in a NoMethodError.

Setting ENV['AMAZONRCDIR'] fixed the issue for me, but perhaps you'd
consider putting an exception trap there, as the NoMethodError is so vague
it was tough to track down.