将木偶代码推送到 git 时出现 ruby​​ 错误

标签 ruby git

我在 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 is facter.

我刚刚看到问题是通过下载 yum.puppetlabs.com
的发行版 我用的是 Red Hat Enterprise 的关系。
现在下载正确的版本没有发生同样的错误

如图所示in this answer ,这也可能是由于 ruby​​ 版本冲突造成的。

但无论如何,它与 Git 没有直接关系。

关于将木偶代码推送到 git 时出现 ruby​​ 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31443709/

相关文章:

ruby - 如何 gsub\in ruby​​ 数组?

git - 如何在 Git 中管理多个开发分支?

git - git实现并发的加锁策略?

ruby - 我怎样才能在一定时间后杀死 ruby 线程?

ruby - 删除嵌套数组的一级

ruby-on-rails - 当值为 nil 时 Rails 继续缓存

javascript - Rails javascript 按钮导致发布

git - .nyc_output 应该包含在 .gitignore 中吗?

git merge 分支像 pull 链一样时尚

macos - GIT - 如何在 OSX 上不使用鼠标复制 SHA?