我之前看到过这个问题,但仅适用于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
,但是已经创建了:在模式表中,存在用户。之前有人收到过此错误吗?
数据库
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: