sudo:bundle:升级GitLab时未找到命令
我正在尝试按照上的说明将我们的GitLab CE服务器升级到GitLab EE 服务器是CentOS 6.7,GitLab CE最初由sudo:bundle:升级GitLab时未找到命令,gitlab,Gitlab,我正在尝试按照上的说明将我们的GitLab CE服务器升级到GitLab EE 服务器是CentOS 6.7,GitLab CE最初由 $ curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash $ sudo yum install gitlab-ce 目前的版本是 $ rpm -q gitlab-ce gitlab-ce-8.7.5-ce.0.el6.x8
$ curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
$ sudo yum install gitlab-ce
目前的版本是
$ rpm -q gitlab-ce
gitlab-ce-8.7.5-ce.0.el6.x86_64
我按照上面链接的步骤操作,但得到一个错误
$ cd /home/git/gitlab
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
sudo: bundle: command not found
我从早期的工作和实践中意识到了这个问题。我认为根本原因是我们安装了rpm,所以
这将足以解决上述问题,但中的后续步骤包括
看来,gitlab-rake
不适用于此,所以我需要实际使用bundle
命令。但我不知道是哪一个——目前磁盘上有19个不同的文件,名为../bin/bundle
,其中7个来自gitlab rpm
那么:当指南告诉我应该使用哪个“bundle”命令
sudo -u git -H bundle install ....
?这可能对您的具体案例有帮助,也可能没有帮助,但我在CentOS 7上运行GitLab CE(社区版)时遇到了类似的问题。一切都进行得很顺利,但在尝试运行一些使用
bundle
的文档化服务命令时,我发现bundle
不在任何人的$PATH
中:root用户和git
用户都不在其中
最后,systemd为我指出了正确的环境,即:
# systemctl status gitlab-runsvdir.service | grep Loaded
Loaded: loaded (/usr/lib/systemd/system/gitlab-runsvdir.service; enabled; vendor preset: disabled)
# grep '^Exec' /usr/lib/systemd/system/gitlab-runsvdir.service
ExecStart=/opt/gitlab/embedded/bin/runsvdir-start
# grep PATH /opt/gitlab/embedded/bin/runsvdir-start
PATH=/opt/gitlab/bin:/opt/gitlab/embedded/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
等等
该脚本(/opt/gitlab/embedded/bin/runsvdir start
)还包含了一些框架来设置正确的运行时环境,这对于适当的研究和应用非常有用
显然,YMMV,特别是如果您不是在systemd下运行GitLab,但类似的方法可能适用于其他init系统
最后值得注意的是(如原始q中所指出的),任何
rake
命令都应该使用gitlab rake
作为普通用户尝试哪个bundle
并使用sudo-u git
的绝对路径运行,如果@mb21所说的不起作用,您也可以尝试手动安装bundle。如果我没记错的话,sudo-hgem安装-g捆绑包应该可以工作。
# systemctl status gitlab-runsvdir.service | grep Loaded
Loaded: loaded (/usr/lib/systemd/system/gitlab-runsvdir.service; enabled; vendor preset: disabled)
# grep '^Exec' /usr/lib/systemd/system/gitlab-runsvdir.service
ExecStart=/opt/gitlab/embedded/bin/runsvdir-start
# grep PATH /opt/gitlab/embedded/bin/runsvdir-start
PATH=/opt/gitlab/bin:/opt/gitlab/embedded/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin