“无法与GitHub建立联系”

时间:2015-10-12 13:33:36

标签: ruby github-api

我正在努力让这个运行到我在github.com上创建的测试组织,但是遇到了这个错误。谁能告诉我什么是错的?

C:\Workspace\Ruby>set GITHUB_TOKEN=xxx

C:\Workspace\Ruby>set GITHUB_API_ENDPOINT=http://api.github.com

C:\Workspace\Ruby>ruby team_audit.rb HudsonsBay
C:/Tools/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:879:in `initialize': No connection could be made because the target machine actively refused it. - connect(2) for "api.github.com" port 80 (Faraday::Conn
ectionFailed)
        from C:/Tools/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:879:in `open'
        from C:/Tools/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:879:in `block in connect'
        from C:/Tools/Ruby21-x64/lib/ruby/2.1.0/timeout.rb:75:in `timeout'
        from C:/Tools/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:878:in `connect'
        from C:/Tools/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:863:in `do_start'
        from C:/Tools/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:852:in `start'
        from C:/Tools/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:1375:in `request'
        from C:/Tools/Ruby21-x64/lib/ruby/2.1.0/net/http.rb:1133:in `get'
        from C:/Tools/Ruby21-x64/lib/ruby/gems/2.1.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http
.rb:80:in `perform_request'
        from C:/Tools/Ruby21-x64/lib/ruby/gems/2.1.0/gems/faraday-0.9.2/lib/faraday/adapter/net_http
.rb:40:in `block in call'
        from C:/Tools/Ruby21-x64/lib/ruby/gems/2.1.0/gems/faraday-
C:\Workspace\Ruby>

1 个答案:

答案 0 :(得分:1)

我试图提出相同的请求并得到同样的错误。

将网址从http://api.github.com更改为https://api.github.com后就可以了。