我在 git 服务器中设置了一个 puppet 预提交 Hook ,从本地推送时出现以下错误:
remote: /usr/share/rubygems/rubygems/path_support.rb:68:in `path=': undefined method `+' for nil:NilClass (NoMethodError)
remote: from /usr/share/rubygems/rubygems/path_support.rb:30:in `initialize'
remote: from /usr/share/rubygems/rubygems.rb:357:in `new'
remote: from /usr/share/rubygems/rubygems.rb:357:in `paths'
remote: from /usr/share/rubygems/rubygems.rb:379:in `path'
remote: from /usr/share/rubygems/rubygems/specification.rb:794:in `dirs'
remote: from /usr/share/rubygems/rubygems/specification.rb:658:in `each_normal'
remote: from /usr/share/rubygems/rubygems/specification.rb:669:in `_all'
remote: from /usr/share/rubygems/rubygems/specification.rb:822:in `each'
remote: from /usr/share/rubygems/rubygems/specification.rb:864:in `find'
remote: from /usr/share/rubygems/rubygems/specification.rb:864:in `find_inactive_by_path'
remote: from /usr/share/rubygems/rubygems.rb:175:in `try_activate'
remote: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
remote: from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:144:in `require'
remote: from <internal:abrt_prelude>:2:in `<compiled>'
最佳答案
pre-commit
Hook 通常是 client-side hook ,所以它不应该安装在服务器端,也不应该被视为“[remote] ...
”。
话虽这么说,还是看到了同样的错误in this thread
The error comes from system ruby.
Have you installed the AIO package?
Maybe it isfacter
.我刚刚看到问题是通过下载
yum.puppetlabs.com
的发行版 我用的是 Red Hat Enterprise 的关系。
现在下载正确的版本没有发生同样的错误
如图所示in this answer ,这也可能是由于 ruby 版本冲突造成的。
但无论如何,它与 Git 没有直接关系。
关于将木偶代码推送到 git 时出现 ruby 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31443709/