gpt4 book ai didi

ruby - 连接拒绝来自 Ruby 的 Git

转载 作者:太空宇宙 更新时间:2023-11-03 16:31:13 25 4
gpt4 key购买 nike

当我尝试将某些内容推送到我的 gitlab 的 geosurvey.git 存储库时,我收到此错误:

enter image description here

git@192.168.31.128: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。

最佳答案

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

现在,通过这一行,我可以推送和克隆任何存储库。

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

关于ruby - 连接拒绝来自 Ruby 的 Git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15622033/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com