Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 在gitlab页面中使用jekyll时,它说当它部署带有gitlab CI的网站时,找不到主题,我已经安装了它 我的目标_Ruby_Gitlab_Jekyll_Gitlab Ci_Jekyll Theme - Fatal编程技术网

Ruby 在gitlab页面中使用jekyll时,它说当它部署带有gitlab CI的网站时,找不到主题,我已经安装了它 我的目标

Ruby 在gitlab页面中使用jekyll时,它说当它部署带有gitlab CI的网站时,找不到主题,我已经安装了它 我的目标,ruby,gitlab,jekyll,gitlab-ci,jekyll-theme,Ruby,Gitlab,Jekyll,Gitlab Ci,Jekyll Theme,要拥有一个包含jekyll站点配置文件但不包含_站点的存储库,每次我推送到存储库时,都会运行一个gitlab管道。有了这个管道,这个网站就是用Jekyll构建的,我用的是这个主题 快速查看我正在处理的基本文件 Gemfile source "https://rubygems.org" # Hello! This is where you manage which Jekyll version is used to run. # When you want to use a different v

要拥有一个包含jekyll站点配置文件但不包含_站点的存储库,每次我推送到存储库时,都会运行一个gitlab管道。有了这个管道,这个网站就是用Jekyll构建的,我用的是这个主题

快速查看我正在处理的基本文件 Gemfile

source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.0.0"
# This is the default theme for new Jekyll sites. You may change this to anything you like.

#######
#THEMES
#######

# MANUALLY COMMENTED
#gem "minima", "~> 2.5"
# New content by me
#gem "jekyll-theme-basically-basic"
#gem 'jekyll-theme-basically-basic', '~> 1.4', '>= 1.4.4'

########################



# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.12"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
  # gem "tzinfo", "~> 1.2"
  # gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
# gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform?

也许你想知道为什么会有这么多评论。这是因为我在gitlab中的部署遇到了问题,我发现如果我将它们安装在.gitlab-ci.yml中,我就不会遇到这些问题

_config.yml

# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
#
# If you need help with YAML syntax, here are some quick references for you: 
# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
# https://learnxinyminutes.com/docs/yaml/
#
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.

lang: es-ES
title: La casa de los titanes
email: adristudy@gmail.com
description: >- # this means to ignore newlines until "baseurl:"
  Write an awesome description for your new site here. You can edit this
  line in _config.yml. It will appear in your document head meta (for
  Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
author:
  name: Adrián Jaramillo
twitter_username: sample
github_username: sample

# Build settings
theme: jekyll-theme-basically-basic
#theme: minima
plugins:
  - jekyll-feed

# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
#
# exclude:
#   - .sass-cache/
#   - .jekyll-cache/
#   - gemfiles/
#   - Gemfile
#   - Gemfile.lock
#   - node_modules/
#   - vendor/bundle/
#   - vendor/cache/
#   - vendor/gems/
#   - vendor/ruby/

# New content by me 
# theme: jekyll-theme-basically-basic

.gitlab-ci.yml

image: ruby:2.5

pages:
  script:
  - gem install jekyll
  #- gem install minima
  - gem install jekyll-theme-basically-basic -v 1.4.1
  - gem install tzinfo -v 1.2.2
  - gem install tzinfo-data
  - bundle install
  - jekyll build --trace -d public/
  artifacts:
    paths:
    - public
  only:
  - master

此外,这里还有公共存储库 当然,在gitlab的docker vm上部署的整个过程都显示了错误 结论 我已经尝试了一切,但在部署的最后一点,我完全迷路了。我可以解决安装问题,但现在我不知道如何解决这个问题。

在您的gem文件中,取消注释gem-jekyll-theme-basic以阅读gem-jekyll-theme-basic


出于某些原因,在您的.gitlab-ci.yml中,所有的gem安装。。。是无用的,而且是包安装完成了所需的工作。

我之所以对gem文件中的所有gem行进行注释,是因为gitlab中的vm说它在gem源代码中找不到gem。这对我来说太奇怪了,因为在我的Gemfile中,gem源是默认的,我还检查了gem是否存在于该源中。此外,这一切都在我的本地虚拟机上工作。因此,我找到了在.gitlab-ci.yml中安装gems所需的解决方案,但后来我遇到了这个错误。你觉得我该怎么办?不管怎样,我会再试试你说的,也许神奇发生了@David JacquelI会把你的答案标记为解决方案,因为它实际上解决了问题。现在的问题是,该网页的部署方式很奇怪。我的意思是,css坏了,有些链接不起作用。如果您想查看,可以查看存储库的gitlab页面,也许您知道发生了什么。无论如何,我会在这里打开另一个帖子来询问that@AdriánJaramillo您需要正确设置url,才能访问CSS url。
Running with gitlab-runner 12.3.0 (a8a019e0)
  on docker-auto-scale ed2dce3a
Using Docker executor with image ruby:2.5 ...
Pulling docker image ruby:2.5 ...
Using docker image sha256:092689b795107d1b2eadb82494acf4764191baa0aa5bf4673b8ee2a50f70ba97 for ruby:2.5 ...
Running on runner-ed2dce3a-project-14628881-concurrent-0 via runner-ed2dce3a-srm-1571178048-5f8825dc...
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/unveiled_adri/jekyll_project/.git/
Created fresh repository.
From https://gitlab.com/unveiled_adri/jekyll_project
 * [new ref]         refs/pipelines/89060084 -> refs/pipelines/89060084
 * [new branch]      master                  -> origin/master
Checking out 745d8811 as master...

Skipping Git submodules setup
$ gem install jekyll
Successfully installed public_suffix-4.0.1
Successfully installed addressable-2.7.0
Successfully installed colorator-1.1.0
Building native extensions. This could take a while...
Successfully installed http_parser.rb-0.6.0
Building native extensions. This could take a while...
Successfully installed eventmachine-1.2.7
Successfully installed em-websocket-0.5.1
Successfully installed concurrent-ruby-1.1.5

HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0

Successfully installed i18n-1.7.0
Building native extensions. This could take a while...
Successfully installed ffi-1.11.1
Building native extensions. This could take a while...
Successfully installed sassc-2.2.1
Successfully installed jekyll-sass-converter-2.0.1
Successfully installed rb-fsevent-0.10.3
Successfully installed rb-inotify-0.10.0
Successfully installed listen-3.2.0
Successfully installed jekyll-watch-2.2.1
Successfully installed kramdown-2.1.0
Successfully installed kramdown-parser-gfm-1.1.0
Successfully installed liquid-4.0.3
Successfully installed mercenary-0.3.6
Successfully installed forwardable-extended-2.6.0
Successfully installed pathutil-0.16.2
Successfully installed rouge-3.12.0
Successfully installed safe_yaml-1.0.5
Successfully installed unicode-display_width-1.6.0
Successfully installed terminal-table-1.8.0
-------------------------------------------------------------------------------------
Jekyll 4.0 comes with some major changes, notably:

  * Our `link` tag now comes with the `relative_url` filter incorporated into it.
    You should no longer prepend `{{ site.baseurl }}` to `{% link foo.md %}`
    For further details: https://github.com/jekyll/jekyll/pull/6727

  * Our `post_url` tag now comes with the `relative_url` filter incorporated into it.
    You shouldn't prepend `{{ site.baseurl }}` to `{% post_url 2019-03-27-hello %}`
    For further details: https://github.com/jekyll/jekyll/pull/7589

  * Support for deprecated configuration options has been removed. We will no longer
    output a warning and gracefully assign their values to the newer counterparts
    internally.
-------------------------------------------------------------------------------------
Successfully installed jekyll-4.0.0
26 gems installed
$ gem install jekyll-theme-basically-basic -v 1.4.1
Successfully installed i18n-0.9.5
Successfully installed sass-listen-4.0.0

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

Successfully installed sass-3.7.4
Successfully installed jekyll-sass-converter-1.5.2
Successfully installed kramdown-1.17.0
Successfully installed jekyll-3.8.6
Successfully installed jekyll-sitemap-1.3.1
Successfully installed jekyll-seo-tag-2.6.1
Successfully installed jekyll-paginate-1.1.0
Successfully installed jekyll-feed-0.12.1
Successfully installed jekyll-theme-basically-basic-1.4.1
11 gems installed
$ gem install tzinfo -v 1.2.2
Successfully installed thread_safe-0.3.6
Successfully installed tzinfo-1.2.2
2 gems installed
$ gem install tzinfo-data
Successfully installed tzinfo-data-1.2019.3
1 gem installed
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using public_suffix 4.0.1
Using addressable 2.7.0
Using bundler 1.17.3
Using colorator 1.1.0
Using concurrent-ruby 1.1.5
Using eventmachine 1.2.7
Using http_parser.rb 0.6.0
Using em-websocket 0.5.1
Using ffi 1.11.1
Using forwardable-extended 2.6.0
Using i18n 1.7.0
Using sassc 2.2.1
Using jekyll-sass-converter 2.0.1
Using rb-fsevent 0.10.3
Using rb-inotify 0.10.0
Using listen 3.2.0
Using jekyll-watch 2.2.1
Using kramdown 2.1.0
Using kramdown-parser-gfm 1.1.0
Using liquid 4.0.3
Using mercenary 0.3.6
Using pathutil 0.16.2
Using rouge 3.12.0
Using safe_yaml 1.0.5
Using unicode-display_width 1.6.0
Using terminal-table 1.8.0
Using jekyll 4.0.0
Using jekyll-feed 0.12.1
Bundle complete! 2 Gemfile dependencies, 28 gems now installed.
Bundled gems are installed into `/usr/local/bundle`
$ jekyll build --trace -d public/
Configuration file: /builds/unveiled_adri/jekyll_project/_config.yml
/usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/theme.rb:76:in `rescue in gemspec': The jekyll-theme-basically-basic theme could not be found. (Jekyll::Errors::MissingDependencyException)
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/theme.rb:73:in `gemspec'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/theme.rb:18:in `root'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/theme.rb:12:in `initialize'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:487:in `new'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:487:in `configure_theme'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:58:in `config='
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/site.rb:23:in `initialize'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:30:in `new'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:30:in `process'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `block in process_with_graceful_fail'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `each'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/command.rb:89:in `process_with_graceful_fail'
    from /usr/local/bundle/gems/jekyll-4.0.0/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
    from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
    from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
    from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
    from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
    from /usr/local/bundle/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
    from /usr/local/bundle/gems/jekyll-4.0.0/exe/jekyll:15:in `<top (required)>'
    from /usr/local/bundle/bin/jekyll:23:in `load'
    from /usr/local/bundle/bin/jekyll:23:in `<main>'
ERROR: Job failed: exit code 1