Jekyll安装示例

Github-blog
CSDN

安装环境

系统版本:ubuntu16.04

root@xftony:xftony.github.io# uname -a
Linux pgw-dev-4 4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

安装ruby

apt-get install ruby ruby-dev

安装gem

apt-get install gem

更新gem源

gem sources --remove https://rubygems.org/
gem sources -a https://ruby.taobao.org/
gem update --system

安装jekyll

gem install jekyll

安装你所需要的插件

gem install jekyll-paginate jekyll-sitemap jekyll-feed
gem install jemoji
......

运行jekyll server

运行jekyll server,然后浏览器登录Server address,如http://127.0.0.1:4000

root@xftony:xftony.github.io# jekyll server     
Configuration file: /root/test/xftony.github.io/_config.yml
            Source: /root/test/xftony.github.io
       Destination: /root/test/xftony.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    done in 3.194 seconds.
 Auto-regeneration: enabled for '/root/test/xftony.github.io'
    Server address: http://127.0.0.1:4000//
  Server running... press ctrl-c to stop.

问题记录

问题:

mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

原因:未安装ruby-dev
解决:

apt-get install ruby-dev

问题:

  In Gemfile:
    jekyll-text-theme was resolved to 1.5.0, which depends on
      jekyll-feed (~> 0.9.2)   

原因:缺少依赖
解决:

gem install jekyll-feed

问题:
jemoji安装失败,查看/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.2/mkmf.log发现:

error: zlib.h: No such file or directory

原因: 缺少zlib的头文件
解决:

//下载zlib源码并编译安装  
wget http://www.zlib.net/zlib-1.2.11.tar.gz  
tar -xf zlib-1.2.11.tar.gz 
cd zlib-1.2.11/
./configure 
make test
make install

//重新安装jemoli
gem install jemoji

猜你喜欢

转载自blog.csdn.net/xftony/article/details/80536507
今日推荐