heroku で rails 3.2.9 を動かすメモ

###
# railsでアプリケーションを作る
###
$ mkdir rails-sample
$ cd rails-sample/

# gemfile を修正(herokuではPostgreSQLのみ無料で使える)
$ vi Gemfile
+ # gem 'sqlite3'
+
+ group :production do
+   gem 'pg'
+ end
+ group :development, :test do
+   gem 'sqlite3'
+ end

$ bundle install
$ rails g scaffold item name:string price:integer description:text
$ git init
$ git commit -m "initial commit"

###
# herokuにデプロイする
###
# email && password を入力
$ heroku login
# どの公開鍵を使うか聞いてくれるので選択するか,新しく作る

# herokuにアプリケーションを作る
$ heroku create

# herokuにpush
$ git push heroku master

# マイグレーション(わーお便利)
$ heroku run:rake db:migrate

# ブラウザで確認(/items にアクセスして確認)
$ heroku open

所感

たったこれだけです.非常に簡単ですね.

参考

http://d.hatena.ne.jp/ke-16/20121130/1354225230