Herokuに画像をアップロードする with Amazon S3 and Paperclip

http://wine4u.seesaa.net/article/170193214.html

herokuのデプロイ
http://d.hatena.ne.jp/yatmsu/20110912/1315829744


ローカルではsqlite3,herokuではpostgresにしないとgit push heroku masterでbundleのエラーがでる.
Gemfile.lockを消してGemfileを編集してbundle installする.
これを終えたらちゃんとgit commit すること.そうしないといくらpushしても反映されない.(これで時間食った)

gem 'pg'とかの書き方は以下を参考に.
http://stackoverflow.com/questions/9009278/cant-push-app-heroku-failed-to-install-gems-via-bundler

(1)sqlite3とpgをdevelopmentとproductで分ける(Gemfileに書き分ける)
(2)RAILS_ROOTは使えない.Rails.rootを使う.
(3)attr_accessor :productとかを設定する(Cannot mass-assign protected attribution...のエラーが出る)
(4)Gemfileにgem 'aws-sdk'を書く
(5)s3.ymlの"Production"の部分にちゃんとsecret keyなどのauthenticationに関するデータを書く