新手问题 做 twitter 的 omniauth 提示 Errno::ECONNABORTED

cqcn1991 · 2013年03月05日 · 最后由 cqcn1991 回复于 2013年03月08日 · 2694 次阅读

按照http://railscasts.com/episodes/235-devise-and-omniauth-revised 这个一步一步做的,我实在也不知道从哪里开始 debug

还没有开始 handle 验证成功以后的东西 就是在点击 Sign in with Twitter,也就是进入 localhost:3000/users/auth/twitter 之后

就提示:

Errno::ECONNABORTED (An established connection was aborted by the software in your host machine. - SSL_connect):
  F:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:799:in `connect'
  F:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
  F:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
  F:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
  F:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:799:in `connect'
  F:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
  F:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:744:in `start'
  F:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/net/http.rb:1284:in `request'
  oauth (0.4.7) lib/oauth/consumer.rb:161:in `request'
  oauth (0.4.7) lib/oauth/consumer.rb:194:in `token_request'
  oauth (0.4.7) lib/oauth/consumer.rb:136:in `get_request_token'
  omniauth-oauth (1.0.1) lib/omniauth/strategies/oauth.rb:29:in `request_phase'
  omniauth-twitter (0.0.14) lib/omniauth/strategies/twitter.rb:63:in `request_phase'
  omniauth (1.1.3) lib/omniauth/strategy.rb:207:in `request_call'
  omniauth (1.1.3) lib/omniauth/strategy.rb:174:in `call!'
  omniauth (1.1.3) lib/omniauth/strategy.rb:157:in `call'
  warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.1) lib/warden/manager.rb:34:in `catch'
  warden (1.2.1) lib/warden/manager.rb:34:in `call'
  actionpack (3.2.11) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'

在 localhost 上面就这样报错。(heroku 上面是 something went wrong....)

本身的 flash 里面就提示: Could not authenticate you from Twitter because "Timeout".

问题解决了 注册 twitter API 的时候一定得填 callback url Make sure to set a callback URL or else you may get authentication errors. (It doesn't matter what it is, just that it is set.)

需要 登录 后方可回复, 如果你还没有账号请 注册新账号