【问题标题】:Cannot push git error: hook declined with remote ruby error无法推送 git 错误:挂钩因远程 ruby​​ 错误而被拒绝
【发布时间】:2017-06-08 01:23:49
【问题描述】:

有一天,我突然无法推到其中一个资源(虽然拉很好)。这是错误日志

Writing objects: 100% (42/42), 11.23 KiB | 0 bytes/s, done.
Total 42 (delta 34), reused 0 (delta 0)
remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/shared_helpers.rb:2:in `require':
 no such file to load-- rubygems (LoadError)
remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/shared_helpers.rb:2
remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/setup.rb:1:in `require'
remote:         from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.6.2/lib/bundler/setup.rb:1
remote: error: hook declined to update refs/heads/master
To http://192.168.1.140:8000/chnn/application2.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'http://192.168.1.140:8000/chnn/application2.git'

我也可以创建一个新项目并将其推送到 gitlab 就好了。只有 1 个项目存在此问题

【问题讨论】:

    标签: ruby git githooks


    【解决方案1】:

    询问你的 git repo 管理员这个错误。这是自定义 git hook(意思是 git 插件)崩溃。

    【讨论】:

    • 我有一个同事,他可以正常推送。如果是服务器问题,他怎么办?
    【解决方案2】:

    好的。所以在我的特殊情况下,在服务器内没有发现问题。我们绝望了,试图通过 ssh 而不是 http 然后 bam,它再次起作用。 最后,我们不知道为什么以及如何。问题仍然存在:

    • 为什么新建项目可以通过http正常推送
    • 为什么其他 没有这个问题

    【讨论】:

      猜你喜欢
      • 2015-04-03
      • 2020-03-12
      • 1970-01-01
      • 1970-01-01
      • 2011-12-20
      • 2014-06-04
      • 1970-01-01
      相关资源
      最近更新 更多