###前提・実現したいこと
railstutorialをやっているのですが、なんとなくデータベースの文字コードをutf8に変えたところ、
$rake -T u8 test
(u8とは、utf8が文字コードのテンプレートデータベースです)
としてもrunningとならず、1 run, 1 assertion, 0 failure,...etc
のような表示がターミナル上に出ず、何事もなく終了してしまいます。
文字コードをSQL_ASCIIに変えれば正常になるのですが、原因が気になります。
わかる人がいたら思いつく理由を教えていただけると嬉しいです。
###該当のソースコード
database.yml
default: &default encoding: unicode pool: 5 development: <<: *default adapter: sqlite3 database: chap6_development test: <<: *default adapter: postgresql database: chap6_test production: <<: *default adapter: sqlite database: chap6_production username: chap6 password: <%= ENV['CHAP5_DATABASE_PASSWORD'] %>
*注:実際にはrake -T u8 testだけしたいだけなので、
development環境やproduction環境は関係ないはずです。
###postgresqlデータベースの様子
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
------------+----------+-----------+---------+-------+-----------------------
chap6_test | ubuntu | UTF8 | C | C |
postgres | postgres | SQL_ASCII | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres
template1 | postgres | SQL_ASCII | C | C | =c/postgres
| | | | | postgres=CTc/postgres
u8 | ubuntu | UTF8 | C | C |
ubuntu | ubuntu | SQL_ASCII | C | C |
(6 rows)
###試したこと
$rake -T u8 test
を実行したが、
何も起きず終了した。
しかし、
文字コードをtemplate0のSQL_ASCIIに変えたときはうまくいきました。
$dropdb chap6_test
$createdb -T template0 chap6_test
$rake -T template0 test
これのときは、
1 run, 1 assertion, 0 failure,...というようにtestが実行されました。
あなたの回答
tips
プレビュー