为什么使用sudo时找不到“bundle”命令:
[root@desktop gitlab]# sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
sudo: bundle: command not found
[root@desktop gitlab]#
但是在不使用sudo时确实存在:
[root@desktop gitlab]# bundle exec rake gitlab:setup RAILS_ENV=production
Warning
You are running as user root, we hope you know what you are doing.
Things may work/fail for the wrong reasons.
For correct results you should run this as user git.
This will create the necessary database tables and seed the database.
You will lose any previous data stored in the database.
Do you want to continue (yes/no)? no
Quitting...
[root@desktop gitlab]#
我问这个问题的原因是我正在遵循https://github.com/gitlabhq/gitlab-recipes/tree/master/install/centos,并且它指示要使用sudo。
我尝试添加-i
标志,如Using $ sudo bundle exec ... raises 'bundle: command not found' error所述,但出现了“此帐户当前不可用”的错误。