I’m having a issue on Debian 9.6. When installing gitlab an error is returned:
Setting up gitlab (8.13.11+dfsg1-8+deb9u3) ...
Creating/updating gitlab user account...
Making gitlab owner of /var/lib/gitlab...
Could not find gem 'rails (~> 4.2, >= 4.2.7.1)' in any of the gem sources listed
in your Gemfile.
dpkg: error processing package gitlab (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
gitlab
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have checked and I have installed both the ruby and the ruby-rails package on the server and are the correct versions: ruby-rails is already the newest version (2:4.2.7.1-1).
I have unpacked the deb file and traced down the issue to this part in the postintall script:
if ! runuser -u ${gitlab_user} -- sh -c 'bundle --local --quiet'; then
if [ "$1" = "triggered" ]; then
# probably triggered in the middle of an system upgrade; ignore failure
# but abort here
echo "#########################################################################"
echo "# Failed to detect gitlab dependencies; if you are in the middle of an #"
echo "# upgrade, this is probably fine, there will be another attempt later. #"
echo "# #"
echo "# If you are NOT in the middle of an upgrade, there is probably a real #"
echo "# issue. Please report a bug. #"
echo "#########################################################################"
exit 0
else
# something is really broken
exit 1
fi
fi
Basically the error mentioned in the question is thrown by the following command: runuser -u ${gitlab_user} -- sh -c 'bundle --local --quiet'
Any suggestion on what could cause this?