git push报错remote: hooks/pre-receive:14:in require_relative'
1 详细错误信息
remote: hooks/pre-receive:14:in require_relative': cannot load such file -- /var/opt/gitlab/git-data/repositories/talkilla/talkilla.git/lib/gitlab_custom_hook (LoadError) remote: from hooks/pre-receive:14:in <main>' To new.gitlab.jiushiyaokuaile.cn:talkilla/talkilla.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'new.gitlab.jiushiyaokuaile.cn:talkilla/talkilla.git'
2 原因 gitlab_custom_hook.rb文件找不到
3 解决方案,修改pre-receive文件,把gitlab_custom_hook的具体路径写对
find / -name 'gitlab_custom_hook.rb' 搜索全局找到正确的路径,写死完整路径就可以了。相对路径可能因为系统的变化导致找不到对应的路径,也可能是丢失了软连接等问题。

浙公网安备 33010602011771号