# S3設定 AWS::S3::Base.establish_connection!( :access_key_id => ACCESS_KEY_ID, :secret_access_key => SECRET_ACCESS_KEY, ); # 東京リージョンの場合設定値を置換します。 if REGION == "Tokyo" then AWS::S3::DEFAULT_HOST.replace "s3-ap-northeast-1.amazonaws.com" end # アップロード AWS::S3::S3Object.store( remote_file, # アップロード先のファイル名 open(local_file), # アップロードしたいローカルファイル BUCKET_NAME, # バケット名 :access => :public_read # 全体に読み込み公開 );