jekyll在ruby下报错

2018-03-26  本文已影响83人  前端妹子ice

运行jekyll serve

问题一

/usr/local/Cellar/ruby/2.4.2_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
    from /usr/local/Cellar/ruby/2.4.2_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/local/lib/ruby/gems/2.4.0/gems/jekyll-3.7.3/lib/jekyll/plugin_manager.rb:48:in `require_from_bundler'
    from /usr/local/lib/ruby/gems/2.4.0/gems/jekyll-3.7.3/exe/jekyll:11:in `<top (required)>'
    from /usr/local/bin/jekyll:23:in `load'
    from /usr/local/bin/jekyll:23:in `<main>'
image.png

解决方法

按照缺失的包bundler

gem install bundler

问题二

你可能会遇到下面的错误信息:
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 https://jekyllrb.com/help/!
Liquid Exception: pygments in /home/gavin/TE/_posts/2017-08-19-welcome-to-jekyll.markdown
ERROR: YOUR SITE COULD NOT BE BUILT:
------------------------------------
pygments

解决方法

代码高亮,在_config.yml中添加“highlighter:rouge”,即可。

上一篇 下一篇

猜你喜欢

热点阅读