安装RubyInstaller和DevKit

进入DevKit安装目录运行如下命令

1
2
ruby dk.rb init
ruby dk.rb install

安装结果如下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
E:\Programs\DevKit>ruby dk.rb init
[INFO] found RubyInstaller v1.9.3 at E:/Programs/Ruby193
Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.
E:\Programs\DevKit>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'E:/Programs/Ruby193'
[INFO] Installing 'E:/Programs/Ruby193/lib/ruby/site_ruby/devkit.rb'
E:\Programs\DevKit>ruby dk.rb review
Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.
E:/Programs/Ruby193

安装效率更好的模版解释器

默认的Maruku是纯ruby的Markdown模版解释器,而RDiscount则是c写的模版解释器,效率更好。可以参考如下别人做的对比

BlueCloth: 13.029987s total time, 00.130300s average
Maruku: 08.424132s total time, 00.084241s average
RDiscount: 00.082019s total time, 00.000820s average

运行以下命令安装

1
gem install rdiscount --platform=ruby

安装成功也能证明之前Ruby和DevKit安装成功。但是因为rdiscount在ruby1.9.2版本上有个bug,安装rdiscount的时候可能会遇到问题,升级到1.9.3可以解决。安装成功结果如下

1
2
3
4
5
6
7
8
9
10
E:\Programs\DevKit>gem install rdiscount --platform=ruby
Fetching: rdiscount-2.1.7.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed rdiscount-2.1.7
1 gem installed
Installing ri documentation for rdiscount-2.1.7...
Installing RDoc documentation for rdiscount-2.1.7...
E:\Programs\DevKit>

然后在站点下的_config.yml文件中加入以下配置

1
markdown: rdiscount

更换淘宝的源及安装Jekyll

运行如下命令

1
2
3
4
5
6
7
8
$ gem sources --remove http://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***
http://ruby.taobao.org
# 请确保只有 ruby.taobao.org
$ gem install jekyll

参考链接:RubyGems 镜像 - 淘宝网

以上安装最好在取得Win7管理员权限的情况下进行。

运行Jekyll

本地运行Jekyll命令如下

1
jekyll serve --watch #不加--watch则不会检测文件夹内的变化,即修改后需要重新启动jekyll