Tutorial 着手

とりま一月一杯ヘビローな方向。

Chapter.1

とりあえず .gemrc をナニ。

$ cat ~/.gemrc
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
$

これ、例の仮想環境なアソコにも盛り込んどいた方が良いな。そしてこのドキュメントでは以下も入れとけ、とあります。

  • libxslt-dev
  • libxml2-dev
  • libsqlite3-dev

一部例の場所に未導入なものがあるのかどうか。

プロジェクト作成

で、rails new first_app しました。最近は bundle install も実行するのね。そして .gitignore も同梱されているご様子。.gitignore は以下も追加しとけ、とあります。

# Ignore other unneeded files.
doc/
*.swp
*~
.project
.DS_Store
.idea

現在、Gemfile を修正して bundle install して .gitignore に上を追加したところです。git init して first commit 作成もしておく。

$ git init
$ git add .
$ git commit -m 'first commit'

あと checkout -f の例が出てますね。

$ ls app/controllers 
application_controller.rb
$ rm app/controllers/application_controller.rb 
$ ls app/controllers 
$ git checkout -f
$ ls app/controllers 
application_controller.rb
$

時間無いので

Github および Heroku な deploy の項は読むだけにしときます。つうか Heroku に rails なソレを deploy する場合は pg な gem が必要なんですね。
以下な記述を Gemfile に追加、とあります。

group :production do
  gem 'pg', '0.12.2'
end

これは Heroku 向けの設定なのでローカルでは以下の方法で bundle install せよ、とありますね。

$ bundle install --without production

時間切れなので続きは別途。