主要流程参考Github Pages

搭建jekyll的流程参考Blogging with Jekyll

其它安装注意事项:

# ruby源总是连不上,使用国内的镜像源
gem sources -l #查看源列表
gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ #修改源地址

# 安装bundle命令
sudo gem install bundler

# 编辑好Gemfile后,安装其它依赖,最好修改bundle的源,如果有较好的外网,这步可以跳过
bundle config mirror.https://rubygems.org https://gems.ruby-china.com/

bundle install

# 启动
bundle exec jekyll serve

# 更新依赖的各种ruby包
bundle update

如果MAC开启SIP,则受保护目录/usr/bin无法写入,所以对命令做一些调整

# 安装到指定目录/usr/local/bin/
gem install -n /usr/local/bin/ bundler
# 调整可执行文件的写入路径到~/bin
bundle install --binstubs=~/bin

修改ruby的镜像源,可以参考链接