Jekyll 安装在 Windows 错误消息

Jekyll install on Windows error message

我想我已经完成了在 windows 上安装 jekyll 的工作,连接正常,但我收到一条错误消息:

Liquid exception: No such file or directory - python C:/Ruby193/lib/ruby/ms/1.9.1/gems/pygments.rb-0.6.3/lib/pygments/mentos.py in _posts/2015-06-09-welcome-to-jekyll.markdown<-[0m done.

Please add the following to your Gemfile to avoid polling for changes: gem 'wdm','>=0.1.0' if Gem.win_platform

我不确定可以忽略哪些消息以及需要修复哪些消息。大家怎么看?

如果将它添加到我的 gemfile 就像输入 cmd 提示一样简单,我需要输入什么来安装它?

这是我几天前通过另一个问题解决的问题。

这里的问题基本上是您需要安装 Python 才能在 Windows 上使用 Jekyll,因为代码高亮 Pygments 是用 Python 编写的,因此需要 Python 功能。 Pygments 也是目前默认的代码高亮器。在以后的 Jekyll 版本中会使用 Rouge highlighter,完全用 Ruby 编写。 This issue is tracked on GitHub.

要解决你现在的问题,你只需要安装Python 2.x,官方链接的教程从Jekyll documentation provides very clear instructions there. You will also need to install pip. I have also included alternatives in the other SO answer I have given, so I will just provide you the 到减少重复信息和复制粘贴。

设置 Python 2.xpip 并安装 pygments 后,您的 Jekyll 安装应该已启动,并且 运行 站点模板!

关于 Gemfile

什么是 Gemfile 的摘要:一个列出特定程序所需的所有 Ruby gem 的文件。例如,您编写了一个依赖于其他 10 个 gem 的 ruby 程序,而不是让您的新 gem 的用户去下载之前的 10 个 gem,然后稍后与过时的 gem 问题作斗争,Gemfile 用于跟踪需要什么 gem 和版本。 GemfileBundler, which is also a gem that automatically keeps track of what gems you need. In the case of Jekyll, you can use a Gemfile to dictate what you want added into your Jekyll install or removed. This is used by GitHub 用来保持本地版本的 Jekyll 和其他 gems 更新为 Github 页面使用的版本。

至于该通知,您需要做的就是避免轮询更改:

  1. 打开记事本或选择的文本编辑器。

  2. 添加这一行:gem 'wdm','>=0.1.0' if Gem.win_platform,就是那一行文字。您稍后可以通过在单独的行中输入 gem 'nameOfGem 来添加 gem。

  3. 在您的 Jekyll 站点文件夹中将文件另存为 Gemfile请注意,没有 .txt 扩展名,您可以在记事本中创建一个没有扩展名的文件,方法是在 'Save As' 下选择 'All Files' 而不是 '.txt'。或者,您可以 edit the file extension 删除 .txt。

  4. 通过执行 gem install bundler.

  5. 安装 bundler
  6. 运行 bundle install 更新 gem。如果您使用 GitHub,请将 Gemfile 和新生成的 Gemfile.lock 添加到 git。