【问题标题】:Bundler compatible versions for gem "jekyll"gem "jekyll" 的 Bundler 兼容版本
【发布时间】:2020-02-29 11:58:42
【问题描述】:

我正在尝试使用 Jekyll 设置 github 页面,目前它正在使用 minima 主题,我想将其更改为 jekyll-theme-hacker。 p>

所以,我去了 Gemfile, 我加了

gem "github-pages", group:jekyll_plugins

gem "minima", "~>2.5"

保存后,我做到了

bundle install

但这给了我错误。

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-hacker was resolved to 0.0.4, which depends on
      jekyll (~> 3.3)

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

我对 Jekyll 和编程非常陌生,我想知道为什么会这样。

据我所知,Bundler 是一个 Gem 管理工具,Gem 代表 ruby​​ 编程语言的库或模块。所以我想做的是尝试为我的新主题安装所有必要的东西。

但是 bundler 找不到 gem "jekyll" 的兼容版本。 这到底是什么意思?我需要不同的 jekyll 依赖项来使用我的新主题吗? 如果是这样,我该怎么做?

非常感谢。

----编辑---- 这就是我的 Gemfile.lock 的样子

GEM
  remote: https://rubygems.org/
  specs:
    addressable (2.7.0)
      public_suffix (>= 2.0.2, < 5.0)
    colorator (1.1.0)
    concurrent-ruby (1.1.5)
    em-websocket (0.5.1)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0.6.0)
    eventmachine (1.2.7)
    ffi (1.11.1)
    forwardable-extended (2.6.0)
    http_parser.rb (0.6.0)
    i18n (1.7.0)
      concurrent-ruby (~> 1.0)
    jekyll (4.0.0)
      addressable (~> 2.4)
      colorator (~> 1.0)
      em-websocket (~> 0.5)
      i18n (>= 0.9.5, < 2)
      jekyll-sass-converter (~> 2.0)
      jekyll-watch (~> 2.0)
      kramdown (~> 2.1)
      kramdown-parser-gfm (~> 1.0)
      liquid (~> 4.0)
      mercenary (~> 0.3.3)
      pathutil (~> 0.9)
      rouge (~> 3.0)
      safe_yaml (~> 1.0)
      terminal-table (~> 1.8)
    jekyll-feed (0.12.1)
      jekyll (>= 3.7, < 5.0)
    jekyll-sass-converter (2.0.1)
      sassc (> 2.0.1, < 3.0)
    jekyll-seo-tag (2.6.1)
      jekyll (>= 3.3, < 5.0)
    jekyll-watch (2.2.1)
      listen (~> 3.0)
    kramdown (2.1.0)
    kramdown-parser-gfm (1.1.0)
      kramdown (~> 2.0)
    liquid (4.0.3)
    listen (3.2.0)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    mercenary (0.3.6)
    minima (2.5.1)
      jekyll (>= 3.5, < 5.0)
      jekyll-feed (~> 0.9)
      jekyll-seo-tag (~> 2.1)
    pathutil (0.16.2)
      forwardable-extended (~> 2.6)
    public_suffix (4.0.1)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.0)
      ffi (~> 1.0)
    rouge (3.11.1)
    safe_yaml (1.0.5)
    sassc (2.2.1)
      ffi (~> 1.9)
    terminal-table (1.8.0)
      unicode-display_width (~> 1.1, >= 1.1.1)
    thread_safe (0.3.6)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    tzinfo-data (1.2019.3)
      tzinfo (>= 1.0.0)
    unicode-display_width (1.6.0)
    wdm (0.1.1)

PLATFORMS
  ruby

DEPENDENCIES
  jekyll (~> 4.0.0)
  jekyll-feed (~> 0.12)
  minima (~> 2.5)
  tzinfo (~> 1.2)
  tzinfo-data
  wdm (~> 0.1.1)

BUNDLED WITH
   2.0.2

【问题讨论】:

    标签: ruby dependencies jekyll blogs


    【解决方案1】:

    这是因为您请求的 Jeykll 版本冲突。一种选择是通过在 Gemfile 中更改您正在使用的 Jeykll 版本来降级它

    -jekyll (~> 4.0.0)
    +jekyll (~> 3.3)
    

    然后运行bundle update jekyll

    如果您想运行最新版本,您可以 fork Gem,更新 jekyll 依赖版本并测试更改。如果它按预期工作,您应该向原始 repo 提交 PR,并可以在等待合并时使用 fork。

    【讨论】:

    • 在我的 Gemfile 中,它被定义为 gem "jekyll", "~&gt; 4.0.0"。所以我把它改成了gem "jekyll", "~&gt; 3.3",但它给了我更多的错误。它说,Bundler could not find compatible versions for gem "jekyll": In Gemfile: github-pages was resolved to 4, which depends on jekyll (= 1.1.2)
    • 你说的fork the Gem是什么意思??? PR 又是什么?
    • 尝试运行bundle update 看看是否可以解决问题。这里概述了分叉 - help.github.com/en/github/getting-started-with-github/… 拉取请求 - help.github.com/en/github/… 如何在 Gemfile 中使用分叉 bundler.io/v1.12/git.html
    • 我遇到了与“jekyll-theme-minimal”相同的问题。我尝试使用 gem "jekyll", "~&gt; 3.9" 并且成功了。
    【解决方案2】:
    • 编辑您的 Gemfile 使其如下所示:
    source 'https://rubygems.org'
    gem 'github-pages'
    
    • 删除您的 Gemfile.lock

    • 启动bundle 命令。

    就是这样! 您已准备好部署到 github 页面。

    【讨论】:

      【解决方案3】:

      版本 3.7 对我有用,您可以尝试检查一下。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-10-31
        • 2017-07-17
        • 2018-02-09
        • 2014-05-26
        • 2014-03-14
        • 2013-03-13
        • 2019-05-07
        • 2016-02-17
        相关资源
        最近更新 更多