gitlab 在 debian 9.6 上安装失败

gitlab 在 debian 9.6 上安装失败

我在 Debian 9.6 上遇到了问题。安装 gitlab 时返回错误:

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)

我已经检查过,并且已经在服务器上安装了 ruby​​ 和 ruby​​-rails 包。

我已经解压了 deb 文件,并将问题追溯到 postintall 脚本中的这一部分:

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

基本上问题中提到的错误是由以下命令引发的:runuser -u ${gitlab_user} -- sh -c 'bundle --local --quiet'

对于可能导致此情况的原因,您有什么建议吗?

相关内容