Update aws-sdk to 1.3
Open files in binary mode when writing to them

Otherwise Ruby 1.9+ will throw Encoding::UndefinedConversionError when
attempting to convert from ASCII-8BIT to UTF8.  AWS::S3::Object#read
returns binary data.  Ruby will default to ASCII-8BIT since it
doesn't have any encoding.
Set Rails.env as well as RAILS_ENV

Recent SunspotSolr has switched to reading this to detect which block in
sunspot.yml it should use for configuration