启用缓存时GitLab CI/CD jekyll生成失败

启用缓存时GitLab CI/CD jekyll生成失败,jekyll,gitlab-ci,gitlab-ci-runner,Jekyll,Gitlab Ci,Gitlab Ci Runner,我正在GitLab CI/CD管道上工作,以构建和部署一个jekyll网站。当我没有激活缓存时,以下设置正在运行 image: ruby:2.6 # Cache gems in between builds cache: key: ${CI_COMMIT_REF_SLUG} paths: - vendor/ruby before_script: - gem install bundler #- ruby -v # Print

我正在GitLab CI/CD管道上工作,以构建和部署一个jekyll网站。当我没有激活缓存时,以下设置正在运行

image: ruby:2.6

# Cache gems in between builds
cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - vendor/ruby

before_script:
  - gem install bundler
  #- ruby -v                      # Print out ruby version for debugging
  #- apt-get update -q && apt-get install nodejs -yqq
  #- bundle install --path vendor # Install dependencies into ./vendor/ruby
  - bundle install

build:
  stage: build
  script:
    - bundle exec jekyll build -d public
  artifacts:
    paths:
    - public
  only:
  - master
  - develop

master-deploy:
  stage: deploy
  before_script:
    # Install ssh client
    - apt-get update
    - apt-get install openssh-client

    # Set up keys
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - echo "$PRIVATE_KEY" > ~/.ssh/id_rsa
    - chmod 600 ~/.ssh/id_rsa

    # Set up known hosts
    - echo "$KNOWN_HOST" > ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts

  script:
    # Install rsync
    - apt-get update -qy
    - apt-get install -y rsync  

    # Transfer files
    ...

    # Backup old versions
    ...

  only:
    - master

develop-deploy:
  stage: deploy
  before_script:
    # Install ssh client
    - apt-get update
    - apt-get install openssh-client

    # Set up keys
    - mkdir -p ~/.ssh
    - chmod 700 ~/.ssh
    - echo "$PRIVATE_KEY" > ~/.ssh/id_rsa
    - chmod 600 ~/.ssh/id_rsa

    # Set up known hosts
    - echo "$KNOWN_HOST" > ~/.ssh/known_hosts
    - chmod 644 ~/.ssh/known_hosts

  script:
    # Install rsync
    - apt-get update -qy
    - apt-get install -y rsync  

    # Transfer files
    ...

    # Backup old version
    ...

  only:
    - develop
一旦激活缓存
构建安装--path vendor
,就会出现以下错误:

Liquid Exception: Liquid syntax error (line 8): Unknown tag 'when' in vendor/ruby/2.6.0/gems/liquid-4.0.3/lib/liquid/locales/en.yml
jekyll 3.8.6 | Error:  Liquid syntax error (line 8): Unknown tag 'when'

我已经删除了GitLab上的缓存(CI/CD->Pipelines->Clear runner cache),但没有成功。非常感谢您的帮助

您是否在脚本命令之前谈论您的缓存?您何时尝试执行
构建安装--path vendor
?是否确实需要
捆绑安装--path vendor
?您可以尝试
bundle exec jekyll build-d public--trace
来获得更多的线索。如果
bunde install--path vendor
可以工作,我会很高兴,因为它不必在每次运行时都安装所有的软件包。