Jekyll无法运行:看起来您没有安装pygments或其依赖项之一。

39
Configuration file: /Users/andrechristoga/Documents/type-theme/_config.yml
       Deprecation: You appear to have pagination turned on, but you haven't included the `jekyll-paginate` gem. Ensure you have `gems: [jekyll-paginate]` in your configuration file.
            Source: /Users/andrechristoga/Documents/type-theme
       Destination: /Users/andrechristoga/Documents/type-theme/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
  Dependency Error: Yikes! It looks like you don't have pygments or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- pygments' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! 
  Liquid Exception: pygments in /Users/andrechristoga/Documents/type-theme/_posts/2014-11-28-markdown-and-html.md
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    pygments

当我输入 jekyll serve 时,以下是显示的信息。


3
安装 Pygments:gem install pygments.rb - Fabrizio Calderan
3个回答

74

我曾遇到同样的问题,但是通过安装 pygments gem 来解决了它。

gem install pygments.rb

并将其添加到我的Gemfile中。

gem 'pygments.rb'

在我的jekyll模板中,我没有Gemfile文件。 - Andre Christoga

-1
如果您是Windows用户,可以将CLI作为管理员运行。这会有所帮助。

-2
如果您使用命令sudo gem install pygments.rbgem install pygments.rb,可能无法正常工作。

因此,您可以尝试使用root权限:

su root
gem install pygments.rb

这解决了我的问题。


1
不建议使用root安装gem,请参考https://dev59.com/AXI95IYBdhLWcg3w2h96。 - ozOli

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接