windows下安装jekyll

首先从http://rubyinstaller.org/downloads/下载以下两个文件进行安装

rubyinstaller-2.0.0-p0.exeDevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe

ruby安装在D:\Ruby200,DevKit安装在D:\rubydevkit

打开CMD进入到DevKit目录,开始初始化安装

D:\rubydevkit>ruby dk.rb init[INFO] found RubyInstaller v2.0.0 at d:/Ruby200Initialization complete! Please review and modify the auto-generated'config.yml' file to ensure it contains the root directories to allof the installed Rubies you want enhanced by the DevKit.D:\rubydevkit>ruby dk.rb install[INFO] Updating convenience notice gem override for 'd:/Ruby200'[INFO] Installing 'd:/Ruby200/lib/ruby/site_ruby/devkit.rb'

接下来使用gem命令安装jekyll

D:\rubydevkit>gem install jekyllFetching: yajl-ruby-1.1.0-x86-mingw32.gem (100%)Successfully installed yajl-ruby-1.1.0-x86-mingw32Fetching: posix-spawn-0.3.6.gem (100%)Temporarily enhancing PATH to include DevKit...Building native extensions.  This could take a while...Successfully installed posix-spawn-0.3.6Fetching: pygments.rb-0.4.2.gem (100%)Successfully installed pygments.rb-0.4.2Fetching: highline-1.6.18.gem (100%)Successfully installed highline-1.6.18Fetching: commander-4.1.3.gem (100%)Successfully installed commander-4.1.3Fetching: safe_yaml-0.7.1.gem (100%)Successfully installed safe_yaml-0.7.1Fetching: colorator-0.1.gem (100%)Successfully installed colorator-0.1Fetching: jekyll-1.0.1.gem (100%)Successfully installed jekyll-1.0.1Parsing documentation for yajl-ruby-1.1.0-x86-mingw32unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/yajl/1.8/yajl.so, skippingunable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/yajl/1.9/yajl.so, skippingInstalling ri documentation for yajl-ruby-1.1.0-x86-mingw32Parsing documentation for posix-spawn-0.3.6Installing ri documentation for posix-spawn-0.3.6Parsing documentation for pygments.rb-0.4.2Installing ri documentation for pygments.rb-0.4.2Parsing documentation for highline-1.6.18Installing ri documentation for highline-1.6.18Parsing documentation for commander-4.1.3Installing ri documentation for commander-4.1.3Parsing documentation for safe_yaml-0.7.1Installing ri documentation for safe_yaml-0.7.1Parsing documentation for colorator-0.1Installing ri documentation for colorator-0.1Parsing documentation for jekyll-1.0.1Installing ri documentation for jekyll-1.0.1Done installing documentation for yajl-ruby, posix-spawn, pygments.rb, highline, commander, safe_yaml, colorator, jekyll (7 sec).8 gems installed

安装完成后,可以使用jekyll -v来检查是否安装成功D:\rubydevkit>jekyll -vjekyll 1.0.1

有的时候由于天朝内网路问题,可能造成以上安装中某一个部分中途退出,再次执行安装时出现以下提示:

D:\rubydevkit>gem install jekyllERROR:  While executing gem ... (NoMethodError)    undefined method `size' for nil:NilClass

在此只需要将gem目录下cache文件夹内清空,重新安装即可。

如果不知道gem目录的可以使用gem env来查看GEM PATHS值,如下所示d:/Ruby200/lib/ruby/gems/2.0.0

D:\rubydevkit>gem envRubyGems Environment:  - RUBYGEMS VERSION: 2.0.0  - RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [i386-mingw32]  - INSTALLATION DIRECTORY: d:/Ruby200/lib/ruby/gems/2.0.0  - RUBY EXECUTABLE: d:/Ruby200/bin/ruby.exe  - EXECUTABLE DIRECTORY: d:/Ruby200/bin  - RUBYGEMS PLATFORMS:    - ruby    - x86-mingw32  - GEM PATHS:     - d:/Ruby200/lib/ruby/gems/2.0.0     - C:/Documents and Settings/aquan/.gem/ruby/2.0.0  - GEM CONFIGURATION:     - :update_sources => true     - :verbose => true     - :backtrace => false     - :bulk_threshold => 1000  - REMOTE SOURCES:     - http://rubygems.org/
windows下安装jekyll

相关文章:

你感兴趣的文章:

标签云: