1

我在 FreeBSD 9.1-RELEASE 上运行 GitLab 5.2 几个月了,一切进展顺利,我看不到明显的问题。

我最近按照 gitlab.org 上提供的指南升级到 6.0,不幸的是我现在遇到如下错误:

No such file or directory - posix_spawnp
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:187:in `_pspawn'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:187:in `pspawn'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:160:in `spawn'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:307:in `popen4'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn/child.rb:105:in `exec!'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn/child.rb:80:in `initialize'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab-grit-2.6.0/lib/grit/git.rb:341:in `new'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab-grit-2.6.0/lib/grit/git.rb:341:in `native'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab-grit-2.6.0/lib/grit/git.rb:368:in `method_missing'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab-grit-2.6.0/lib/grit/repo.rb:558:in `log'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/repository.rb:180:in `log'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/commit.rb:52:in `find'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/commit.rb:64:in `last'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/repository.rb:90:in `has_commits?'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/gitlab_git-2.1.0/lib/gitlab_git/repository.rb:96:in `empty?'
/tank/gitlab/gitlab/app/models/repository.rb:17:in `empty?'
/tank/gitlab/gitlab/app/models/project.rb:345:in `empty_repo?'
/tank/gitlab/gitlab/lib/tasks/gitlab/check.rake:519:in `block in check_repos_post_receive_hooks_is_link'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `block (2 levels) in find_each'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `each'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:21:in `block in find_each'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:72:in `find_in_batches'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/batches.rb:20:in `find_each'
/tank/gitlab/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/querying.rb:8:in `find_each'

我绝对不是专家,但我不确定 FreeBSD 是否提供任何 posix 兼容性。我已经手动安装了 posix-spawn gem,但没有任何区别。我无法通过搜索找到帮助,我能看到的唯一类似情况归结为缺少 pygments,但我已经安装了。

以后版本不能在 FreeBSD 上使用 GitLab 吗?我看到非官方的 FreeBSD/GitLab 安装指南仅适用于 5.1 和 5.2,因此这可能是一个迹象。如果是这样,那就太可惜了,GitLab 是一款很棒的软件,我不想放弃它。

欣赏一些见解,谢谢

4

1 回答 1

0

确保在gitlab/config/gitlab.yml中设置了正确的git路径,因为 FreeBSD 默认将 ports/packages 安装到 /usr/local:

git:
  bin_path: /usr/local/bin/git

然后重新启动 GitLab。

如何调试这个:

在第 187 行将函数的 vars 打印到gitlab/vendor/bundle/ruby/1.9/gems/posix-spawn-0.3.6/lib/posix/spawn.rb(根据需要进行调整):

puts "DEBUG"
puts env
puts argv
puts options
      _pspawn(env, argv, options)

运行应用程序状态:

# bundle exec rake gitlab:check RAILS_ENV=production

{}
[["/usr/bin/git", "/usr/bin/git"], "--git-dir=/home/git/repositories/root/git-playground-project.git", "rev-parse", "HEAD"]
{:in=>#<IO:fd 13>, #<IO:fd 14>=>:close, :out=>#<IO:fd 16>, #<IO:fd 15>=>:close, :err=>#<IO:fd 18>, #<IO:fd 17>=>:close}

找到调试行并验证参数。

祝你好运!

于 2013-09-29T20:20:46.347 回答