script/generate scaffold でDB接続エラー
とりあえず今、ここ見ながらやっている。
http://www008.upp.so-net.ne.jp/letitbe/rails003.htm
$ script/generate scaffold Article Admin exists app/controllers/ exists app/helpers/ exists app/views/admin exists app/views/layouts/ exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ identical app/models/article.rb identical test/unit/article_test.rb identical test/fixtures/articles.yml Connection refused - /tmp/mysql.sock
で調べたところ、/etc/my.cnf の中で、mysql.sock の場所が、/var/lib/mysql/mysql.sock になっていた。
ので、config/database.ymlの中身を書き換える。
ruby mysql.sockで検索したら結構はまっている人多いみたいだな。
俺と同じ原因だった人。
http://fg-180.katamayu.net/archives/2005/08/25/185402
自分はMySQLを特に何も考えずにインストールで、mysql.sockの位置が、/var/lib/mysql.sockの下だったんだけど、/tmp/mysql.sock って場所はなんなんだろ。
ちなみに、/etc/my.cnf でソケットの位置を、/tmp/mysql.sock にし変更してやっても同様に動いた。