2016-02-19 93 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 

相關問題