2016-02-19 95 views
0

昨天我更新了gitlab 8.4.3到8.4.4,在升级过程中我得到了一个与Gemfile.lock权限有关的错误,升级过程中断了。如何在gitlab上运行bundle安装?

今天,我无法访问我的gitlab安装,我跟踪误差丢失的宝石,当我运行gitlab-rails

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 

我怎样才能安装这个宝石?运行软件包安装的正确方法是什么?

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

更新:2016年2月22日

原来,gitlab不提供bundle install命令,宝石都包含在的.deb文件。因此,我所需要做的就是跳过迁移,只安装新版本,然后 - 确保所有文件都已正确安装 - 运行迁移。

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

普罗蒂普:在排除故障时,确保一切正确安装,然后运行gitlab-ctl reconfigure;它可以解决常见问题。

+0

你使用rbenv还是rvm? – faron

+0

@faron我不知道。 gitlab嵌入了它的ruby和rails版本,我不知道gitlab如何配置它自己的环境。 – ceochronos

回答

-1

gitlab不提供bundle install命令,宝石包括在的.deb文件。

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

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

更新:更好的脚本


案例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 

相关问题