Skip to content

Fixing the "No route matches {:controller= "omniauth_callbacks"..." error after db:migrate

Rafael Barboza edited this page May 27, 2013 · 2 revisions

After the first setup, if you get this error:

No route matches {:controller=>"omniauth_callbacks", :action=>"passthru", :provider=>"facebook"}

You just need to run rake db:seed to add the OauthProvider entry for facebook and then restart the server.


On a side note, if you run rake db:migrate and get the error below, dont worry, it's caused by the rails initiation and will not affect the migration.

'PG::Error: ERROR: relation "oauth_providers" does not exist LINE 5: WHERE a.attrelid = '"oauth_providers"'::regclas... ^ : 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 = '"oauth_providers"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum