Gitlab 解决reconfigure 出错一例

通过

curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash yum install gitlab-ce
安装好gitlab-ce版后 执行 gitlab-ctl reconfigure

出现

 * ruby_block[directory resource: /var/opt/gitlab/git-data] action run

================================================================================
Error executing action `run` on resource 'ruby_block[directory resource: /var/opt/gitlab/git-data]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of test "$(stat --printf='%F %U %04a' /var/opt/gitlab/git-data)" = 'directory git 0700' ----
STDOUT:
STDERR:
---- End output of test "$(stat --printf='%F %U %04a' /var/opt/gitlab/git-data)" = 'directory git 0700' ----
Ran test "$(stat --printf='%F %U %04a' /var/opt/gitlab/git-data)" = 'directory git 0700' returned 1

开始以为权限问题 反复尝试重装gitlab 找权限问题 死活不行 折腾到晚上1点

后来忽然想到是不是环境变量的问题 用export输出 发现这个hostname不对 后面加了主机名.localhost之类 对应修改为hostname后

再执行gitlab-ctl reconfigure 结果就可以了

全文完!