6

目标

使用 Jekyll 启动 Github 页面。我正在关注Github Pages 文档

问题

执行时:

bundle exec jekyll 3.8.7 new .

返回以下错误:

fatal: 'jekyll 3.8.7' could not be found. You may need to install the jekyll-3.8.7 gem or a related gem to be able to use this subcommand..

另请注意,(a)Jekyll 3.8.7 是Github Pages 的当前依赖版本,(b)如果我为 Jekyll 4.1.0 尝试它,则会返回相同的错误。

语境

我尝试了这篇 SO 帖子中的建议-- $ bundle init, $ bundle add jekyll-- 但这并没有解决我的问题。

系统详情:

$ which ruby
/Users/vishrutarya/.rbenv/shims/ruby

$ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]

$ jekyll -v
jekyll 4.1.0

$ which jekyll
/Users/vishrutarya/.gem/ruby/2.7.0/bin/jekyll

4

2 回答 2

4

对我来说,添加下划线就可以了。我手动安装了 3.8.7 版。使用gem list,您可以检查它是否实际安装。然后我用bundle exec jekyll _3.8.7_ new . --force了它,它起作用了。

于 2020-07-19T09:58:50.117 回答
3

在 MacOS 上遇到同样的问题。这就是我最终做的事情:

  1. 创建一个新目录,我们称之为blog
  2. bundle init
  3. 在 Gemfile 中,添加行gem "jekyll", "= 3.8.7"
  4. bundle i
  5. 您可以通过发出来验证 jekyll 版本bundle exec jekyll -v
  6. 在同一文件夹中创建docs/目录
  7. bundle exec jekyll new .
  8. 在目录bundle i中再次运行docs/
  9. 要服务,bundle exec jekyll servedocs/目录中运行

我希望这有帮助!

于 2020-06-11T04:16:51.663 回答