Jekyll&&Github---使用jekyll在github上面搭建个人博客

下载安装jekyll

apt-get install ruby

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第1张图片

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第2张图片

gem install jekyll

安装错误:

ERROR:  Could not find a valid gem 'jekyll' (>= 0), 
here is why:Unable to download data from https://rubygems.org/ - no such name (https://api.rubygems.org/latest_specs.4.8.gz)

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第3张图片

查看当前的gem源:gem sources -l

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第4张图片

这绝逼是我大天朝的原因,访问不到呗!

更换Gem sources,改为淘宝的镜像
gem sources –remove https://rubygems.org/

gem sources -a http://ruby.taobao.org/

或者写为一个命令:

gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/

这里写图片描述

查看当前gem源:gem sources -l

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第5张图片

再次安装:apt-get install jekyll

报错:

Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
    ERROR: Failed to build gem native extension.

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

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/ffi-1.9.10 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/ffi-1.9.10/gem_make.out

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第6张图片

错误说明:构建本地扩展(程序)失败

apt-get install ruby2.1-dev

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第7张图片

再次安装jekyll : apt-get install jekyll

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第8张图片

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第9张图片

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第10张图片

安装成功!耶。。。

新建自己的博客地址

jekyll new hjrblog

启动服务

jekyll serve

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第11张图片

浏览器查看

http://localhost:4000

Jekyll&&Github---使用jekyll在github上面搭建个人博客_第12张图片

更换博客模板

你可能感兴趣的:(文章)