Jekyll站点地图没有在Gitlab中构建

时间:2016-05-09 17:59:35

标签: jekyll gitlab gitlab-ci

在推送到Gitlab.io时包含*/5 * * * * /usr/bin/xte -x :0 "key F5" gem会导致构建失败。当我在本地运行jekyll时,jekyll-sitemap文件夹中正确生成了sitemap.xml

为了在Gitlab中构建my _site gem,我需要做些什么?或者,我应该在推送到Gitlab之前以某种方式排除jekyll-sitemap宝石?

的Gemfile

jekyll-sitemap

_config.yml

source "https://rubygems.org"
ruby '2.0.0'
gem 'jekyll'
gem 'jekyll-sitemap'
gem 'sass'

Gitlab构建输出

gems:
- jekyll-sitemap

运行$ gem install jekyll Successfully installed safe_yaml-1.0.4 Successfully installed rouge-1.10.1 Successfully installed mercenary-0.3.6 Successfully installed liquid-3.0.6 Successfully installed kramdown-1.11.1 Building native extensions. This could take a while... Successfully installed ffi-1.9.10 Successfully installed rb-inotify-0.9.7 Successfully installed rb-fsevent-0.9.7 Successfully installed listen-3.0.7 Successfully installed jekyll-watch-1.4.0 Successfully installed sass-3.4.22 Successfully installed jekyll-sass-converter-1.4.0 Successfully installed colorator-0.1 Successfully installed jekyll-3.1.3 14 gems installed $ jekyll build -d public/ /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:94:in `block in materialize': Could not find jekyll-sitemap-0.10.0 in any of the sources (Bundler::GemNotFound) from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `map!' from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `materialize' from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in `specs' from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in `specs_for' from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler/definition.rb:171:in `requested_specs' from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in `requested_specs' from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in `setup' from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup' from /usr/local/bundle/gems/jekyll-3.1.3/lib/jekyll/plugin_manager.rb:33:in `require_from_bundler' from /usr/local/bundle/gems/jekyll-3.1.3/bin/jekyll:9:in `<top (required)>' from /usr/local/bundle/bin/jekyll:22:in `load' from /usr/local/bundle/bin/jekyll:22:in `<main>' 后的终端输出:

bundle

1 个答案:

答案 0 :(得分:1)

编辑回答

事实上,答案就在你的.gitlab-ci.yml。我想这个文件包含的内容如下:

...
pages:
  stage: deploy
  script:
    - gem install jekyll
    - jekyll build -d public
...

如果你想以这种方式运行gitlab-ci(没有bundler),这个文件必须包含如下内容:

...
pages:
  stage: deploy
  script:
    - gem install jekyll
    - gem install jekyll-sitemap
    - jekyll build -d public
...

这是my test repository .gitlab-ci.yml file

请参阅gitlab-ci documentation

旧回答:为什么不使用bundle exec jekyll build -d public/