Fork me on GitHub

jekyll环境安装

在狗爹上面买了域名之后,忍不住搭了博客,这次用的github page + jekyll的静态博客。

jekyll的口号就是将纯文本转化成静态网站和博客,尝试了一下,发现很好用,官方网站:http://jekyll.bootcss.com/

安装Homebrew的开发环境

1
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

可能会碰到以下情况

1
2
fatal: unable to access 'https://github.com/Homebrew/homebrew/': SSLRead() return error -9806 Failed during: git fetch origin
master:refs/remotes/origin/master -n --depth=1

需要在/etc/resolv.conf中加上

1
2
nameserver 8.8.8.8<br>
nameserver 114.114.114.114

如果出现了Permission denied需要分配权限

1
sudo chown -R $USER /usr/local

在Mac上面配置jekyll的开发环境首先需要需要配置好rvm,否则会报各种花式错误!

1
curl -L https://get.rvm.io | bash -s stable

然后重新source一下

1
source ~/.rvm/scripts/rvm

接下我就开始安装ruby-2.1.1,但是报了如下错误:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.1.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Installing requirements for osx.
Updating system.......
Error running 'requirements_osx_brew_update_system ruby-2.1.1',
showing last 15 lines of /Users/ivan/.rvm/log/1436855825_ruby-2.1.1/update_system.log
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ rvm_pretty_print stderr
++ case "${rvm_pretty_print_flag:=auto}" in
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ return 1
Requirements installation failed with status: 1.

谷歌了很久,提供的方案就是

1
2
3
4
5
6
7
8
brew install autoconf
brew install automake
brew install libtool
brew install homebrew/dupes/apple-gcc42
brew install libyaml
brew install libxslt
brew install libksba
brew install openssl

然后运行

1
rvm install 2.1.1

接着开始安装jekyll

1
2
3
4
gem install jekyll
jekyll new my-awesome-site
cd my-awesome-site
jekyll serve

最后就是Markdown语法高亮的问题

1
gem install redcarpet

然后去修改_congif.yml

1
2
3
markdown: redcarpet
redcarpet:
extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "strikethrough", "superscript"]

版权声明



Ivan’s Blog by Ivan Ye is licensed under a Creative Commons BY-NC-ND 4.0 International License.
叶帆创作并维护的叶帆的博客博客采用创作共用保留署名-非商业-禁止演绎4.0国际许可证

本文首发于Ivan’s Blog | 叶帆的博客博客( http://yeziahehe.com ),版权所有,侵权必究。

本文链接:http://yeziahehe.com/2015/07/15/jekyll_env_build/