jekyll 的安装

静态网站生成器Jekyll 是一个简洁的、特别针对博客平台的 静态网站 生成器。它使用一个模板目录作为网站布局的基础框架,并在其上运行 Textile 、 Markdown 或 Liquid 标记语言的转换器,最终生成一个完整的静态Web站点,可以被放置在Apache或者你喜欢的其他任何Web服务器上。它同时也是 GitHub Pages 、一个由 GitHub 提供的用于托管项目主页或博客的服务,在后台所运行的引擎,本站基于Jekyll构建.

安装过程如下:

$ gem install jekyll
    Fetching: liquid-2.5.5.gem (100%)
    Successfully installed liquid-2.5.5
    Fetching: fast-stemmer-1.0.2.gem (100%)
    ERROR:  Error installing jekyll:
    The 'fast-stemmer' native gem requires installed build tools.

    Please update your PATH to include build tools or download the DevKit
    from 'http://rubyinstaller.org/downloads' and follow the instructions
    at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

报错了,提示我们下载安装"DevKit",这里下载安装即可,然后又提示我们在http://github.com/oneclick/rubyinstaller/wiki/Development-Kit找答案。

安装了DevKit后切换到DevKit的安装目录:cd<devkit_install_dir>
执行 ruby dk.rb init 生成config.yml配置文件
最后 ruby dk.rb install 安装 DevKit 到你ruby中。对于64位操作系统来说,
可能会报错:‘Invalid configuration. Please fix ‘config.yml’ and rerun ‘ruby dk.rb install’`.
解决方案是将ruby目录的绝对路径写在config.yml中,如下:

# This configuration file contains the absolute path locations of all
# installed Rubies to be enhanced to work with the DevKit. This config
# file is generated by the 'ruby dk.rb init' step and may be modified
# before running the 'ruby dk.rb install' step. To include any installed
# Rubies that were not automagically discovered, simply add a line below
# the triple hyphens with the absolute path to the Ruby root directory.
#
# Example:
#
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
#
---
- C:\Ruby200-x64

注意规则:在---下,以 - 开头,然后空一格,然后是写ruby的绝对路径。

然后再试 ruby dk.rb install.如下提示:

$ ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby200-x64'
[INFO] Installing 'C:/Ruby200-x64/lib/ruby/site_ruby/devkit.rb'

那么就说明安装成功了,然后就安装jekyll吧

$ gem install jekyll
    Temporarily enhancing PATH to include DevKit..
    Building native extensions.  This could take a
    Successfully installed fast-stemmer-1.0.2
    Fetching: classifier-1.3.4.gem (100%)
    Successfully installed classifier-1.3.4
    Fetching: rb-fsevent-0.9.4.gem (100%)
    ......

检测是否安装成功:

$ jekyll -v
jekyll 1.4.3

提示ok了!

上一篇:CSS3 旋转的八卦图


下一篇:如何将一个本来需要发几十条sql语句的需求优化成两条(非sql语句优化,而是解决方法)