2
votes

I am trying to install GitLab on a Debian Wheezy and experiencing an issue I don't understand.

Following the install guide for version 5.0:

  • step 1: was run as explained
  • step 2: I used rvm (multi-user install) instead (ruby-1.9.3-p392)
  • steps 3 to 5: were run as explained (MySQL chosen)
  • step 6: everything works fine until the "Install Gems" section, where I get the following error:
/home/git/gitlab$ sudo -u git -H bundle install --deployment --without development test postgres
sudo: unable to execute /usr/local/bin/bundle: No such file or directory

I run this as my normal user (in the sudo and rvm groups), and the git user is not a sudoer.

I think that the line sudo gem install bundler, in step 2, does not grant the git user to execute bundle properly, but I don't know how to fix this.

I probably did something wrong but cannot figure out what it is, as I tried to respect the standard instructions as close as possible.

Any clue about this? Thanks, I am losing hope...

For information, I have written to the GitLab mailing-list about this problem but did not get any answer. Moreover, last time I asked something similar on ServerFault, I have been advised to post on StackOverflow instead... hence this question :)

2
By the way, I did not manage to show the bash line as code, if anyone wants to edit my post...astorije
Can user git execute bundle? Where is bundle installed?VonC
When I do $ which bundle, I get /usr/local/rvm/gems/ruby-1.9.3-p392/bin/bundle. The git user has been created with the --disabled-login flag and thus I cannot login as git to run bundle. When I do $ sudo -u git bundle, I get sudo: unable to execute /usr/local/bin/bundle: No such file or directory but my normal user can execute bundle even without sudoing it. Does this answer your question? :s Also, thanks for editing my post, didn't think of the <pre> tag!astorije
That must be because /usr/local/rvm/gems/ruby-1.9.3-p392/binisn't in the path of git. You have various solutions for that: stackoverflow.com/a/257666/6309 or superuser.com/q/98686/141VonC
If you can avoid editing the sudoers file, it is always better. See my answer below.VonC

2 Answers

1
votes

When I do $ which bundle, I get /usr/local/rvm/gems/ruby-1.9.3-p392/bin/bundle.
The git user has been created with the --disabled-login flag and thus I cannot login as git to run bundle.
When I do $ sudo -u git bundle, I get

sudo: unable to execute /usr/local/bin/bundle: No such file or directory

That means git user has not /usr/local/rvm/gems/ruby-1.9.3-p392/bin in its PATH, and you cannot modify its .profile or .bashrc because of the --disabled-login flag.

It seems that running sudo -i -u git bundle instead of sudo -u git bundle does the trick

That is the safest route, and will execute the command as git, but will simulate first an initial login, using the PATH defined in .profile and .bashrc of user root.
See "How does sudo search the path for executable?" for more.

0
votes

On my local machine after upgrade from 6.4 to 7.7 I had such issue.

The compilation of ruby was made under root account.

So need permissions to read compiled ruby and installed bundle.

chmod ugo+rx /usr/local/bin/bundle
chmod -R ugo+rX /usr/local/lib/ruby/

In production mode You could be more strict.