2013-03-25 82 views
2

到Git当我试图把东西我gitlab的geosurvey.git回购我得到这个错误:连接被拒绝从红宝石

enter image description here

[email protected]:geosurvey.git: /usr/local/lib/ruby/1.9.1/net/http.rb:762!in `initialize': Connection refused(2) (Errno:ECONNREFUSED) 
    from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `open' 
    from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `block in connect' 
    from /usr/local/lib/ruby/1.9.1/timeout.rb:54:in `timeout' 
    from /usr/local/lib/ruby/1.9.1/timeout.rb:99:in `timeout' 
    from /usr/local/lib/ruby/1.9.1/net/http.rb:762:in `connect' 
    from /usr/local/lib/ruby/1.9.1/net/http.rb:755:in `do_start' 
    from /usr/local/lib/ruby/1.9.1/net/http.rb:744:in `start' 
    from /home/git/gitlab-shell/lib/gitlab_net.rb:56:in `get' 
    from /home/git/gitlab-shell/lib/gitlab_net.rb:17:in `allowed?' 
    from /home/git/gitlab-shell/lib/gitlab_shell.rb:51:in `validate_access' 
    from /home/git/gitlab-shell/lib/gitlab_shell.rb:21:in `exec' 
    from /home/git/gitlab-shell/lib/gitlab_shell.rb:16:in `<main>' 

上述错误是此代码:

def connect 
     D "opening connection to #{conn_address()}..." 
     s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) } 
     D "opened" 
     if use_ssl? 
     ssl_parameters = Hash.new 
     iv_list = instance_variables 
     SSL_ATTRIBUTES.each do |name| 
      ivname = "@#{name}".intern 
      if iv_list.include?(ivname) and 
      value = instance_variable_get(ivname) 
      ssl_parameters[name] = value 
      end 
     end 
     @ssl_context = OpenSSL::SSL::SSLContext.new 
     @ssl_context.set_params(ssl_parameters) 
     s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context) 
     s.sync_close = true 
end 

可能是我的gitlab.yml或/ etc/nginx/sites-available/gitlab有问题?

感谢,


麻烦的是我不能让我的远程gitlab服务器的SSH连接。我的SSH端口为22(默认)和我gitlab端口是3222

+0

这意味着它说什么,它无法连接。没有任何代码或配置,没有人能回答这个问题,它可能是任何事情。 – 2013-03-25 18:30:40

+0

你使用代理吗? – ted 2013-03-25 18:47:09

+7

不要使用图像来显示错误(或某些人做的代码)。 Stack Overflow的部分价值在于它是可搜索的。图像击败了这一点,降低了你的问题的价值。 – 2013-03-25 19:03:14

回答

0

The trouble is I can't get a ssh connection with my remote gitlab server. My ssh port is 22 (default) and my gitlab port is 3222.

然后,你需要使用SSH Gitlab URL时,要确保使用的端口3222。
您可以在配置文件中指定自定义端口号,如this question中所述,也在scp-style的“Using a remote repository with non-standard port”中进行了说明。
或者你直接指定你的SSH URL中的端口:

ssh://[[email protected]]host.xz[:port]/path/to/repo.git/ 
1

gitlab的安装指南缺少监听端口应如何进行配置。

现在,我可以推送并克隆任何存储库。

listen *:80 default_server;   # e.g., listen 192.168.1.1:80; 
+0

非常好。我的回答是关于ssh,但如果Apache服务器配置不正确,我认为你会得到相同的错误信息。 +1 – VonC 2013-03-26 16:39:03

+0

感谢您的帮助! gitlab的安装指南有一个错误。 Gitlab使用nginx服务器来部署应用程序。 – Proverbio 2013-03-27 12:43:04

+0

刚刚意识到我在最后一条评论中提到了一个+1 ......但实际上并未提高您的答案。所以+1现在。 – VonC 2013-03-27 13:11:45