繁体   English   中英

如何在gitlab上运行捆绑安装?

[英]How to run bundle install on gitlab?

昨天我将gitlab 8.4.3更新为8.4.4,在升级过程中,我收到与Gemfile.lock权限有关的错误,升级过程被中断。

今天,当我运行gitlab-rails时,我无法访问我的gitlab安装,我将错误追溯到缺少的gem

Could not find ruby-saml-1.1.1 in any of the sources
Run `bundle install` to install missing gems.

当我尝试运行sudo -u git -H bundle install我得到了

sudo: bundle: command not found

如何安装该gem? 哪种正确的方式运行捆绑软件安装?

gitlab是通过apt-get安装/升级的。

更新时间:2016-02-22

事实证明gitlab不提供bundle install命令,gem包含在.deb文件中。 因此,我要做的就是跳过迁移,只安装新版本,然后-一旦所有文件都正确安装-运行迁移。

touch /etc/gitlab/skip-auto-migrations
apt-get dist-upgrade
gitlab-ctl reconfigure

protip:在进行故障排除时,请确保所有内容gitlab-ctl reconfigure正确安装,然后运行gitlab-ctl reconfigure 它可以解决常见问题。

更新:更好的脚本


情况1。

image: ruby:2.1

# add bundle cache to 'vendor' for speeding up builds
cache:
  paths: 
    - vendor/

before_script:
  - bundle install --path vendor

deploy:
  stage: deploy
  script:
    - bundle exec <your_script>
  only:
    - master # the job 'deploy' will affect only the 'master' branch

情况2:何时需要JS运行时

image: ruby:2.1

before_script:
  - apt-get update -qy
  - apt-get install -y nodejs
  - bundle install --path vendor

cache:
  paths: 
    - vendor/

deploy:
  stage: deploy
  script:
  - bundle exec <your_script>
  only:
    - master # the job 'deploy' will affect only the 'master' branch

gitlab不提供bundle install命令,gem包含在.deb文件中。

因此,只需安装新版本(跳过迁移),然后运行迁移。

touch /etc/gitlab/skip-auto-migrations
apt-get dist-upgrade
gitlab-ctl reconfigure

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM