1

我是新手Jekyll,我正在尝试为我的测试项目安装新主题,以便找到更适合的主题。

基本上,这是我遵循的程序:

  1. 下载(或克隆)主题的来源~/gems/gems/
  2. 进入~/gems/gems/<new_theme>目录
  3. bundle install
  4. 如果可行,请转到我的项目文件夹并
  5. 编辑Gemfile_config.yml名称
  6. bundle install

到目前为止,我尝试了至少 5-6 个主题,但都没有奏效。大多数时候我得到这种错误:

Bundler could not find compatible versions for gem "jekyll":
  In snapshot (Gemfile.lock):
    jekyll (= 4.0.0)

  In Gemfile:
    jekyll (~> 4.0.0)

    jekyll-theme-clean-blog was resolved to 4.0.1, which depends on
      jekyll (~> 3.6)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

但我无法理解。 Gemfile.lock表示版本jekyll是 4.0.0 Gemfile表示所需版本jekyll大于或等于 4.0.0 -> OK jekyll-theme-clean-blog取决于jekyll大于或等于 3.6 -> OK

那么为什么会失败呢?如依赖链所述,我的 4.0.0 版本大于 3.6。我的错在哪里?

4

1 回答 1

2
**jekyll-theme-clean-blog was resolved to 4.0.1, which depends on
  jekyll (~> 3.6)

意味着 Bundler 想要使用的版本,4.0.1jekyll-theme-clean-blog版本取决于~> 3.6.jekyll

~> 3.6>= 3.6 && < 4.0. 因此`jekyll 4.0.0 不匹配。

你有两个选择:

  1. 因为 Bundler 已经找到了最新版本之一,jekyll-theme-clean-blog并且该最新版本仍然需要jekyll ~> 3.8.5您必须降级jekyll~> 3.6
  2. 你必须完全摆脱jekyll-theme-clean-blog宝石。
于 2020-01-12T12:42:42.350 回答