我以前看到过这个问题,但只针对 rspec。我还没有创建测试,因为它对我来说太高级了,但有一天我会的!:P
当我尝试注册/登录我的应用程序时出现此错误。我使用 devise 创建用户,还使用omniauth2使用google登录。
这是错误
ActiveRecord::StatementInvalid at /users/auth/google_oauth2/callback
PG::UndefinedTable: ERROR: relation "users" does not exist
LINE 5: WHERE a.attrelid = '"users"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"users"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
我试过rake db:migrate
了,但它已经创建了:在模式表中存在用户。以前有人遇到过这个错误吗?
数据库.yml
config=/opt/local/lib/postgresql84/bin/pg_config
development:
adapter: postgresql
encoding: unicode
database: tt_intraweb_development
pool: 5
username: my_username
password:
test:
adapter: postgresql
encoding: unicode
database: tt_intraweb_test
pool: 5
username: my_username
password:
production:
adapter: postgresql
encoding: unicode
database: tt_intraweb_production
pool: 5
username: my_username
password: