根据Gitlab 官网的安装方法,在执行以下命令时出现了问题:
sudo apt-get install gitlab-ce
具体错误如下:
There was an error running gitlab-ctl reconfigure:
bash[migrate gitlab-rails database] (gitlab::database_migrations line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash" "/tmp/chef-script20190428-15510-28f5ti" ----
STDOUT: WARNING: No valid license encryption key provided.
rake aborted!
NameError: uninitialized constant Elasticsearch
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/elastic_client_setup.rb:5:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:6:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure => environment
(See full trace by running task with --trace)
STDERR:
---- End output of "bash" "/tmp/chef-script20190428-15510-28f5ti" ----
Ran "bash" "/tmp/chef-script20190428-15510-28f5ti" returned 1
安装的gitlab安装包来源与版本信息:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/ubuntu xenial InRelease
gitlab-ce (11.10.1-ce.0)
服务器信息:
Description: Ubuntu 16.04.6 LTS (x86_64)
Release: 16.04
Codename: xenial
已经试过的方法
- 重装Gitlab
- 把Gitlab换成低版本的(一路调到8)
- 安装后,重启服务器
第一次执行了
sudo apt-get install gitlab-ee
,发现不对后卸载了。之后再次执行
sudo apt-get install gitlab-ce
就报问题里的错误。后来把有关gitlab的文件都清理干净后安装成功。
我清理的文件目录如下: