【问题标题】:Bundler could not find compatible versions for gem "bundler": In Gemfile:Bundler 找不到 gem "bundle" 的兼容版本:在 Gemfile 中:
【发布时间】:2019-12-01 20:41:57
【问题描述】:

我正在使用 Jekyll 制作 GitHub 博客页面。我已经失败了无数次,只是分叉了一个新的,并在存储库中按照 README 进行操作。

这是https://github.com/janczizikow/sleek/blob/master/README.md 我试图在目录(主)内运行,但这个消息不断出现。

我在互联网上尝试了“gem install bundler”、“gem cleanup”和类似的解决方案,但仍然无法修复。我知道我需要另一个较低的版本,那么如何删除当前版本并安装我需要的版本?

我从未使用过 Ruby,所以我很迷茫。一点建议意义重大。

bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 1.12) x64-mingw32

  Current Bundler version:
    bundler (2.0.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (~> 1.12)' in any of the relevant sources:
  the local ruby installation

【问题讨论】:

    标签: ruby github rubygems jekyll


    【解决方案1】:

    版本 2.0.2 来自 gem install bundler,但该项目使用捆绑器版本 1.12。

    要解决您的问题,请运行

    1. gem install bundler -v 1.12
    2. bundle _1.12_ install

    要启动 Jekyll,请运行 jekyll servebundle exec jekyll serve

    【讨论】:

    • 感谢您的回答!但即使在我执行了“gem install bundler -v 1.12”之后,它仍然显示相同的味精。也许我应该完全删除 Windows 上的最新版本?或者我该怎么办?
    • 我已经更新了我的答案。之后你需要运行bundle _1.12_ install
    • 非常感谢!按照您的回答后,bundle install 工作。但是然后输入npm install,它说gyp ERR! configure error gyp ERR! stack Error: Command failed: C:\Program Files (x86)\Python36-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "<string>", line 1 gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
    • 不知道,您的问题与 ruby​​ 和 bundler 有关。对不起。不知何故与note gyp有关,但我根本不知道。
    • 我在谷歌上搜索...发现这个:重建本机节点模块需要 node-gyp,这需要 Python 2。安装 Python 2 并确保它在 %PATH% 中的第一个(即,在 Python 2.7 之前,你已安装),因此 node-gyp 可以找到它。
    猜你喜欢
    • 2014-03-14
    • 2012-04-08
    • 1970-01-01
    • 1970-01-01
    • 2011-10-31
    • 1970-01-01
    • 2017-07-17
    • 2018-02-09
    • 2014-05-26
    相关资源
    最近更新 更多