与Heroku的Omniauth问题

时间:2014-12-06 22:57:52

标签: omniauth

我实施了omniauth以允许用户通过Twitter登录。一切都在我当地的环境中顺利进行。但是,在推送到Heroku之后,我收到了一个错误。重定向到Twitter之后以及单击以授权应用程序后出现错误。有人能指出我正确的方向吗?

Heroku日志:

2014-12-06T22:54:36.173266+00:00 app[web.1]: Started GET "/auth/twitter/callback?oauth_token=0YwVXdIdacx8lK2g31xgtYN5PJzBrthV&oauth_verifier=6gYtUY1sHAimjOPQ2P9FBWqkG4t85wf1" for 207.62.246.40 at 2014-12-06 22:54:36 +0000
2014-12-06T22:54:36.179194+00:00 app[web.1]: I, [2014-12-06T22:54:36.178840 #2]  INFO -- omniauth: (twitter) Callback phase initiated.
2014-12-06T22:54:36.784626+00:00 app[web.1]: Processing by SessionsController#create as HTML
2014-12-06T22:54:36.784637+00:00 app[web.1]:   Parameters: {"oauth_token"=>"0YwVXdIdacx8lK2g31xgtYN5PJzBrthV", "oauth_verifier"=>"6gYtUY1sHAimjOPQ2P9FBWqkG4t85wf1", "provider"=>"twitter"}
2014-12-06T22:54:36.801839+00:00 app[web.1]: Completed 500 Internal Server Error in 17ms
2014-12-06T22:54:36.805144+00:00 app[web.1]: 
2014-12-06T22:54:36.805147+00:00 app[web.1]: NameError (undefined local variable or method `omniauth' for #<Class:0x007f88aa8b7c90>):
2014-12-06T22:54:36.805149+00:00 app[web.1]:   app/models/user.rb:11:in `block in create_with_omniauth'
2014-12-06T22:54:36.805150+00:00 app[web.1]:   app/models/user.rb:7:in `create_with_omniauth'
2014-12-06T22:54:36.805152+00:00 app[web.1]:   app/controllers/sessions_controller.rb:4:in `create'
2014-12-06T22:54:36.805154+00:00 app[web.1]: 
2014-12-06T22:54:36.805155+00:00 app[web.1]: 
2014-12-06T22:54:36.808588+00:00 heroku[router]: at=info method=GET path="/auth/twitter/callback?oauth_token=0YwVXdIdacx8lK2g31xgtYN5PJzBrthV&oauth_verifier=6gYtUY1sHAimjOPQ2P9FBWqkG4t85wf1" host=www.insidertees.com request_id=c242efb5-8070-4bea-848e-b5542dcf79f1 fwd="207.62.246.40" dyno=web.1 connect=2ms service=638ms status=500 bytes=1754

1 个答案:

答案 0 :(得分:0)

愚蠢的错误。将omniauth更改为auth。问题解决了。