jekyll在win8下的本地安装
一、ruby的安装
<p>我是在win8 64位系统下进行安装的,所以ruby要下载相应的版本(版本一定要用最新版本!!!!!!!我因为没有安装最新版本,出现了很多问题,换了新版本就迎刃而解了~)下载地址:http://rubyinstaller.org/downloads/

下载完成之后就直接点击下一步进行安装,安装完成之后将文件的bin路径加入到系统环境变量path中,

最后在cmd命令中输入ruby -v查看是否成功,出现版本信息即可。

二、下载安装"DevKit"
在和ruby同样的下载地址中下载

下载完成之后点击下一步进行安装,安装了DevKit后在cmd中切换到DevKit的安装目录,执行 ruby dk.rb init 生成config.yml配置文件,最后 ruby dk.rb install 安装 DevKit 到你ruby中。这个流程我没有出现问题,如果出现了什么问题可以将问题贴到浏览器中进行搜索,有很多关于这方面问题的解答。命令中出现[info]的字样就说明安装成功了。
三、安装jekyll
输入命令gem install jekyll,然而事情并不会那么一帆风顺,一般会因为镜像的原因无法安装jekyll。解决办法:
用gem sources -l查看当前镜像

然后用gem sources -- remove 删除镜像

最后用gem sources --add安装现在国内可以使用的镜像(淘宝镜像貌似不能用了,我用的是
http://gems.ruby-china.org/
镜像,注意是http,不是https)
镜像修改成功之后就可以用gem install jekyll安装jekyll了

命令结束之后用jekyll -v命令查看是否安装成功

四、在本地新建自己的博客
任意进入一个文件夹,用jekyll new my-awesome-site
命令新建博客文件夹,运行之后如果没有安装bundler会提醒你要用gem安装bundler

新建博客

进入博客文件夹路径

最后用jekyll server命令开启博客端口,我第一次运行的时候出现了端口被占用错误

解决这个问题只需要在_config.yml文件的最后一行加上
port: 5001
即可
重新运行jekyll server命令,在浏览器中进入http://localhost:5001即可

五、部署到github中运行
首先要有自己的github仓库,在自己的github中新建一个username.github.io的仓库,然后将本地的项目上传到仓库中即可
$ git init $ git add . $ git commit -m "init blog" $ git remote add origin xxxxxxx(拷贝github的地址)xxxxxxx.git $ git push origin master
init.png
add.png
commit.png
remote.png
push.png
最后在浏览器中访问username.github.io即可!!!
接下来就是如何使用jekyll建设属于自己的博客了!!!