启动jekyll服务错误


问题描述

因为重装了系统, 导致 启动`jekyll`服务错误

$ jekyll server
/usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler (LoadError)
    from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /var/lib/gems/2.3.0/gems/jekyll-3.4.3/lib/jekyll/plugin_manager.rb:34:in `require_from_bundler'
    from /var/lib/gems/2.3.0/gems/jekyll-3.4.3/exe/jekyll:9:in `<top (required)>'
    from /usr/local/bin/jekyll:22:in `load'
    from /usr/local/bin/jekyll:22:in `<main>'

解决方法

发现是因为没有安装bundler, 直接安装即可.

$ sudo gem install jekyll bundler

$ sudo bundle update jekyll

如果发现缺少要求版本的gem包, 则可以使用 gem install 直接安装, 如果需要安装特定版本的包, 则可以使用gem install package -v 1.0.0安装.

$ jekyll server
WARN: Unresolved specs during Gem::Specification.reset:
      ffi (>= 0.5.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/var/lib/gems/2.3.0/gems/bundler-1.14.6/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find addressable-2.5.0 in any of the sources (Bundler::GemNotFound)

$ gem list

*** LOCAL GEMS ***

addressable (2.5.1)
  ...

$ sudo gem install addressable -v 2.5.0

参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录