1.安装ruby(mac上自带,此步可以跳过)

2.安装jekyll

  • 安装jekyll

    1
    gem install jekyll
  • 顺利地安装完成之后,可以生成自己的一个博客

    1
    jekyll new myBlog
  • 接下来尝试进入博客运行一下

    1
    2
    cd myBlog
    jekyll server
  • hin难受,果然报了个错!!!错误输出如下:

    1
    2
    3
    4
    5
    6
    /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in 'require': cannot load such file -- bundler (LoadError)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in 'require'
    from /Library/Ruby/Gems/2.3.0/gems/jekyll-3.8.3/lib/jekyll/plugin_manager.rb:48:in 'require_from_bundler'
    from /Library/Ruby/Gems/2.3.0/gems/jekyll-3.8.3/exe/jekyll:11:in '<top (required)>'
    from /usr/local/bin/jekyll:22:in 'load'
    from /usr/local/bin/jekyll:22:in '<main>'
  • 接下来就是上网找了找如何解决该问题,因为笔者也是小白,第一次搭博客,所幸找到了解决方案,感激!解决办法如下:

  • 安装bundle

    1
    2
    3
    gem install bundle
    gem install minima
    gem install jekyll-feed
  • 本以为完成了,就开心的开启了一下:

    1
    bundle exec jekyll serve
  • 但是!但是!但是!它又报了一个错!

    1
    2
    Could not find public_suffix-3.0.0 in any of the sources
    Run `bundle install` to install missing gems.
  • 好的是,只要我们认真听话的执行一下提示代码就可以了!

    1
    bundle install
  • 然后等待全部安装完成

    1
    2
    3
    ......
    Bundle complete! 4 Gemfile dependencies, 23 gems now installed.
    Use `bundle info [gemname]` to see where a bundled gem is installed.
  • 最后启动!

    1
    bundle exec jekyll serve
  • 然后打开http://127.0.0.1:4000 ,就能完美的看到自己的博客啦,jekyll就已经安装完成咯。