We (at FamilyLearn) have been using Amazon S3 for photo storage in our new system. The Ruby libraries are still a little young, so we run in to trouble occasionally.

For example, today I was unable to limit the number of keys returned from a bucket with the :max_keys option. As it turns out, the Amazon API expects “max-keys” even though Ruby syntax does not allow dashes in its symbols. This turned out to be a simple problem to fix:

@files = @@s3_connection.list_bucket(
  @current_bucket,
  :prefix => @prefix,
  :"max-keys" => 15).entries