jekyll 2 升级 jekyll 3 Dependency Error

来源:互联网 发布:windows vista系统重装 编辑:程序博客网 时间:2024/06/03 20:10
  • 症状:
    因为这篇文章GitHub Pages now faster and simpler with Jekyll 3.0,打算将jekyll 2升级到jekyll 3。

    执行 gem update jekyll 后,查看jekyll版本 jekyll --version确已升级至到时最新的3.1.1版本.但是在本地启动运行jekyll serve --watch却发生以下错误:

    Dependency Error: Yikes! It looks like you don’t have kramdown 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 – kramdown’ If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/!

    当然了,错误显示的kramdown我是确定已经安装了。如果不确定,您可以查看是否已安装:gem list | grep kramdown. 如果您还没有请安装:gem install kramdown

    问题的关键是不存在提示的 kramdown Dependency Error。GitHub端正常运行,GitHub blog可以照常访问,只是本地无法运行。

  • 解决办法
    本地启动时执行:

    bundle exec jekyll serve --watch

    在之前的命令 jekyll serve --watch 加上bundle exec . 因为我使用了 bundler 管理了gems.

    参考:https://github.com/jekyll/jekyll/issues/3084

1 0