【发布时间】:2019-11-22 03:38:01
【问题描述】:
我正在使用GitLab-CI/CD 构建我的Rails 应用程序。我注意到由于Using a custom path while using system gems is unsupported 错误,我的构建失败了,之前它工作得很好。
尝试检查较新的更新版本,但未发现任何问题。有没有人对提到的问题的最新更新或某些东西有任何想法?
下面是我的gitlab-ci.yml
variables:
GIT_SUBMODULE_STRATEGY: recursive
cache:
key: ${CI_JOB_NAME}
paths:
- vendor/ruby
before_script:
- apt-get update -qq
- ruby -v
- which ruby
- gem --version
- git --version
- gem update --system 2.7.6
- gem install bundler -v 2.0.1
- bundle -v
- bundle config ${REPO_URL} ${BUNDLE_GITLAB__TOKEN}
- bundle config --global disable_shared_gems true
- bundle install --jobs $(nproc) "${FLAGS[@]}" --path vendor
rubocop:
tags:
- rubocop
script:
- bundle exec rubocop
# rspec:
# stage: test
# script:
# - bundle exec rspec
下面是我遇到的简短错误
$ apt-get update -qq
$ ruby -v
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
$ which ruby
/usr/local/bin/ruby
$ gem --version
3.0.3
$ git --version
git version 2.20.1
$ gem update --system 2.7.6
Updating rubygems-update
Successfully installed rubygems-update-2.7.6
Installing RubyGems 2.7.6
Bundler 1.16.1 installed
RubyGems 2.7.6 installed
Regenerating binstubs
------------------------------------------------------------------------------
RubyGems installed the following executables:
/usr/local/bin/gem
/usr/local/bin/bundle
RubyGems system software updated
$ gem install bundler -v 2.0.1
Successfully installed bundler-2.0.1
1 gem installed
$ bundle -v
Bundler version 2.0.1
$ bundle config https://gitlab.com/dharshannn/test-star.git ${BUNDLE_GITLAB__TOKEN}
$ bundle config --global disable_shared_gems true
$ bundle install --jobs $(nproc) "${FLAGS[@]}" --path vendor
Using a custom path while using system gems is unsupported.
path:
Set for your local app (/usr/local/bundle/config): "vendor"
path.system:
Set via BUNDLE_PATH__SYSTEM: true
disable_shared_gems:
Set for the current user (/root/.bundle/config): true
ERROR: Job failed: exit code 1
【问题讨论】:
-
从今天开始遇到完全相同的问题。我的 CI-config 文件不包含添加的捆绑配置语句
bundle config --global disable_shared_gems true。如果将其删除,CI 将失败并显示以下消息。You have not configured a value for `disable_shared_gems` -
这刚刚昨晚也在 Gitlab 上开始发生在我们身上,我们的系统没有任何变化。有谁知道为什么会发生这种情况?
-
在官方
ruby镜像的Dockerfile 中,BUNDLE_PATH__SYSTEM=true看起来是added recently。更改has been reverted,但似乎没有图像已通过此修复重建和发布。
标签: ruby-on-rails gitlab bundler gitlab-ci