Jekyll Install

“Yeah It’s on. ”

jekyll安装

1
2
3
4
5
6
xcode-select --install #  install the command-line tools
gem install --user-install bundler jekyll # home directory

# .~/.bash_profile or ~/.bashrc
export GEM_HOME=$HOME/gems
export PATH=$HOME/gems/bin:$PATH

出现问题

1
2
active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.

问题分析:
定位到xcode安装失败,或者未安装。
本例中没有安装xcode。

解决方案:

1
2
xcode-select --install # 单独安装CommandLineTools,不需要Xcode
sudo xcode-select --switch /Library/Developer/CommandLineTools  # 指定路径

解决这一步之后,提示安装成功。但是有一个warning:

1
2
You don't have /Users/ericwang/.gem/ruby/2.3.0/bin in your PATH,
	  gem executables will not run.

选择了忽略。
但是在执行jekyll时,提示jekyll: command not found

1
2
3
# 将这一行加入到.bash_profile中
/Users/ericwang/.gem/ruby/2.3.0/bin
source .bash_profile

然后就OK了

1
2
3
jekyll new myblog
cd myblog
jekyll serve