Omniauth不使用heroku

时间:2013-12-18 03:06:02

标签: ruby-on-rails heroku omniauth

我在我的程序中使用了Omniauth facebook twitter n身份,但是当我将它们上传到Heroku时,他们不会工作。回调函数返回错误,如下图所示。enter image description here

这是我的heroku网址http://rapd-primer-generator.herokuapp.com/

Heroku Logs

←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m
←[36m2013-12-18T03:03:29.789711+00:00 app[web.1]:←[0m                 FROM pg_attribute a LEFT JOIN pg_attrdef d
←[36m2013-12-18T03:03:29.789711+00:00 app[web.1]:←[0m                   ON a.attrelid = d.adrelid AND a.attnum = d.adnum
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m PG::UndefinedTable: ERROR:  relation "users" does not exist
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m LINE 5:                WHERE a.attrelid = '"users"'::regclass
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m                                           ^
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m                WHERE a.attrelid = '"users"'::regclass
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m                  AND a.attnum > 0 AND NOT a.attisdropped
←[36m2013-12-18T03:03:29.790087+00:00 app[web.1]:←[0m                ORDER BY a.attnum
←[36m2013-12-18T03:03:29.790087+00:00 app[web.1]:←[0m
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m :               SELECT a.attname, format_type(a.atttypid, a.atttypmo
d),
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m                      pg_get_expr(d.adbin, d.adrelid), a.attnotnull,
a.atttypid, a.atttypmod
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m                 FROM pg_attribute a LEFT JOIN pg_attrdef d
←[36m2013-12-18T03:03:29.789912+00:00 app[web.1]:←[0m                   ON a.attrelid = d.adrelid AND a.attnum = d.adnum
←[36m2013-12-18T03:03:29.790087+00:00 app[web.1]:←[0m Completed 500 Internal Server Error in 2ms
←[36m2013-12-18T03:03:29.790087+00:00 app[web.1]:←[0m Completed 500 Internal Server Error in 2ms
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m                                           ^
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation
 "users" does not exist
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m LINE 5:                WHERE a.attrelid = '"users"'::regclass
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m :               SELECT a.attname, format_type(a.atttypid, a.atttypmo
d),
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m                      pg_get_expr(d.adbin, d.adrelid), a.attnotnull,
a.atttypid, a.atttypmod
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m                 FROM pg_attribute a LEFT JOIN pg_attrdef d
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m                ORDER BY a.attnum
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m ):
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m   app/controllers/sessions_controller.rb:5:in `create'
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m                   ON a.attrelid = d.adrelid AND a.attnum = d.adnum
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m                WHERE a.attrelid = '"users"'::regclass
←[36m2013-12-18T03:03:29.791238+00:00 app[web.1]:←[0m                  AND a.attnum > 0 AND NOT a.attisdropped
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m :               SELECT a.attname, format_type(a.atttypid, a.atttypmo
d),
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m                      pg_get_expr(d.adbin, d.adrelid), a.attnotnull,
a.atttypid, a.atttypmod
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m                 FROM pg_attribute a LEFT JOIN pg_attrdef d
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m                   ON a.attrelid = d.adrelid AND a.attnum = d.adnum
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m                WHERE a.attrelid = '"users"'::regclass
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m                  AND a.attnum > 0 AND NOT a.attisdropped
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m ActiveRecord::StatementInvalid (PG::UndefinedTable: ERROR:  relation
 "users" does not exist
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m LINE 5:                WHERE a.attrelid = '"users"'::regclass
←[36m2013-12-18T03:03:29.791403+00:00 app[web.1]:←[0m                                           ^
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m                ORDER BY a.attnum
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m ):
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m   app/controllers/sessions_controller.rb:5:in `create'
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m
←[36m2013-12-18T03:03:29.791566+00:00 app[web.1]:←[0m
←[33m2013-12-18T03:03:29.794223+00:00 heroku[router]:←[0m at=info method=GET path=/auth/facebook/callback?code=AQB8lYz8fjS
1rxjJWc0ZWTj9JOqKdhmGgWwqwzfItW9c_18kcDBdCsu_OoKGJK9aD9XtZe268FxxdyGdw6_pPavwA1uFuktZKzc0nlRwWhzsoIXslcFnIOaRhpoWYsjtGd1Dc
OhLGPpButi0suJB6D3r8IZIkrvGFKJn20QU3XCGc0OW0e9_-DGl95Om_5hc4-rc4ENXln5n6YIgn_d56HlKSOqcPqpOgojUZW6I1A10j-Iy7VoDM_iHCg4OZkH
K9ndvFa-v9Eeg_D--qFDwt-xfOpfvDX0x2hksOzXujKE7CydKf8dyGLngj9Skm8_kF7I&state=b08913b8a48fe78c7452a9cfe5bae10847a01f8891924e7
4 host=rapd-primer-generator.herokuapp.com fwd="203.106.57.160" dyno=web.1 connect=1ms service=332ms status=500 bytes=1266

←[36m2013-12-18T03:03:30.949582+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 03:03:
30 +0000
←[36m2013-12-18T03:03:30.949816+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 03:03:
30 +0000
←[36m2013-12-18T03:03:30.951304+00:00 app[web.1]:←[0m I, [2013-12-18T03:03:30.951204 #2]  INFO -- omniauth: (facebook) Req
uest phase initiated.
←[33m2013-12-18T03:03:30.968870+00:00 heroku[router]:←[0m at=info method=GET path=/auth/facebook host=rapd-primer-generato
r.herokuapp.com fwd="203.106.57.160" dyno=web.1 connect=0ms service=14ms status=302 bytes=263
←[33m2013-12-18T03:03:26.635532+00:00 heroku[router]:←[0m at=info method=GET path=/auth/facebook host=rapd-primer-generato
r.herokuapp.com fwd="203.106.57.160" dyno=web.1 connect=7ms service=10ms status=302 bytes=263
←[33m2013-12-18T03:03:27.108203+00:00 heroku[router]:←[0m at=info method=GET path=/auth/facebook host=rapd-primer-generato
r.herokuapp.com fwd="203.106.57.160" dyno=web.1 connect=1ms service=37ms status=302 bytes=263
←[36m2013-12-18T04:06:05.068976+00:00 heroku[web.1]:←[0m State changed from up to down
←[36m2013-12-18T04:06:05.068456+00:00 heroku[web.1]:←[0m Idling
←[36m2013-12-18T04:06:07.578461+00:00 heroku[web.1]:←[0m Stopping all processes with SIGTERM
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m [2013-12-18 04:06:08] FATAL SignalException: SIGTERM
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `se
lect'
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:32:in `sta
rt'
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:170:in `bl
ock in start'
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:160:in `st
art'
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/web
rick.rb:14:in `run'
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/server.rb:2
64:in `start'
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/co
mmands/server.rb:84:in `start'
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/co
mmands.rb:80:in `block in <top (required)>'
←[36m2013-12-18T04:06:08.114330+00:00 app[web.1]:←[0m   /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/co
mmands.rb:75:in `tap'
←[36m2013-12-18T04:06:08.114557+00:00 app[web.1]:←[0m   /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc2/lib/rails/co
mmands.rb:75:in `<top (required)>'
←[36m2013-12-18T04:06:08.114557+00:00 app[web.1]:←[0m   bin/rails:4:in `require'
←[36m2013-12-18T04:06:08.114557+00:00 app[web.1]:←[0m   bin/rails:4:in `<main>'
←[36m2013-12-18T04:06:08.114557+00:00 app[web.1]:←[0m [2013-12-18 04:06:08] INFO  going to shutdown ...
←[36m2013-12-18T04:06:08.114557+00:00 app[web.1]:←[0m [2013-12-18 04:06:08] INFO  WEBrick::HTTPServer#start done.
←[36m2013-12-18T04:06:08.114557+00:00 app[web.1]:←[0m Exiting
←[36m2013-12-18T04:06:09.427666+00:00 heroku[web.1]:←[0m Process exited with status 143
←[36m2013-12-18T04:07:04.934787+00:00 heroku[web.1]:←[0m Starting process with command `bin/rails server -p 52272 -e $RAIL
S_ENV`
←[36m2013-12-18T04:07:07.573685+00:00 app[web.1]:←[0m [2013-12-18 04:07:07] INFO  WEBrick 1.3.1
←[36m2013-12-18T04:07:07.573685+00:00 app[web.1]:←[0m [2013-12-18 04:07:07] INFO  ruby 2.0.0 (2013-11-22) [x86_64-linux]
←[36m2013-12-18T04:07:07.574111+00:00 app[web.1]:←[0m [2013-12-18 04:07:07] INFO  WEBrick::HTTPServer#start: pid=2 port=52
272
←[36m2013-12-18T04:07:08.149958+00:00 heroku[web.1]:←[0m State changed from starting to up
←[36m2013-12-18T04:07:09.059936+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 04:07:
09 +0000
←[36m2013-12-18T04:07:09.059936+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 04:07:
09 +0000
←[36m2013-12-18T04:07:09.059936+00:00 app[web.1]:←[0m => Booting WEBrick
←[36m2013-12-18T04:07:09.059936+00:00 app[web.1]:←[0m => Rails 4.0.0.rc2 application starting in production on http://0.0.
0.0:52272
←[36m2013-12-18T04:07:09.059936+00:00 app[web.1]:←[0m => Ctrl-C to shutdown server
←[36m2013-12-18T04:07:09.059936+00:00 app[web.1]:←[0m => Run `rails server -h` for more startup options
←[36m2013-12-18T04:07:09.116009+00:00 app[web.1]:←[0m I, [2013-12-18T04:07:09.115802 #2]  INFO -- omniauth: (facebook) Req
uest phase initiated.
←[33m2013-12-18T04:07:09.141261+00:00 heroku[router]:←[0m at=info method=GET path=/auth/facebook host=rapd-primer-generato
r.herokuapp.com fwd="203.106.57.160" dyno=web.1 connect=1ms service=89ms status=302 bytes=263
←[33m2013-12-18T04:07:09.253958+00:00 heroku[router]:←[0m at=info method=GET path=/auth/facebook host=rapd-primer-generato
r.herokuapp.com fwd="203.106.57.160" dyno=web.1 connect=1ms service=7ms status=302 bytes=263
←[36m2013-12-18T04:07:09.245932+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 04:07:
09 +0000
←[36m2013-12-18T04:07:09.245932+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 04:07:
09 +0000
←[36m2013-12-18T04:07:09.246794+00:00 app[web.1]:←[0m I, [2013-12-18T04:07:09.246695 #2]  INFO -- omniauth: (facebook) Req
uest phase initiated.
←[36m2013-12-18T04:07:09.530789+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 04:07:
09 +0000
←[36m2013-12-18T04:07:09.530789+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 0


















←[36m2013-12-18T04:07:09.530789+00:00 app[web.1]:←[0m Started GET "/auth/facebook" for 203.106.57.160 at 2013-12-18 0


















←[36m2013-12-18T04:07:11.388464+00:00 app[web.1]:←[0m Started GET "/auth/facebook/callback?code=AQDSHpYLRJjoWUCDkzYBt
oqNdcZ52pLfVMDLavNxEjLHUd4t25DaOidbMp2ZT-xoLw3Ofvct6U9vAn2oQhg9d9TqoMSaq9AIQbj1SCvVJGDncm8LkZLP6PTHzZ6JBMI_P6f_og4i9Y
NgQ5sGQeV1rEp6XrQGIWv8-Q9f6CVlwIMqUjrTMCowkAXY8OI2zjv3UR3iFrmTEx1qQSQ28ymyZ1t3JZgkmRC68LOQVBL8V5Is170IyHfAweM6_vpoBxK
9dpmUnbzdOCiPX8Za5551Ll1VTcobq76grkIK0mVfYwwCmvqaWnsk&state=3d94ebb29e2ed79ce10f256ed2039d252910a68f180a9471" for 203
57.160 at 2013-12-18 04:07:11 +0000
←[36m2013-12-18T04:07:11.389143+00:00 app[web.1]:←[0m I, [2013-12-18T04:07:11.389069 #2]  INFO -- omniauth: (facebook
lback phase initiated.

1 个答案:

答案 0 :(得分:2)

您似乎忘记了迁移数据库

heroku run rake db:migrate