将puppet代码推送到git时出现ruby错误

时间:2015-07-16 00:56:55

标签: ruby git

我在git服务器中有一个puppet pre-commit 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>'

1 个答案:

答案 0 :(得分:0)

pre-commit挂钩通常是client-side hook,因此不应安装在服务器端,也不应将其视为“[remote] ...”。

话虽如此,看到同样的错误in this thread

  
    

错误来自系统ruby     你安装了AIO包吗?     也许是facter

  
     

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

in this answer所示,这也可能是因为ruby版本存在冲突。

但无论如何,它与Git直接相关。