如何安装jekyll
-
安装brew
1 |
|
-
安装ruby
brew install ruby
-
更换Ruby镜像
先移除现在的镜像 终端输入:
gem sources --remove https://rubygems.org/
然后替换成现在大中华地区可用的(taobao的那个镜像已经不好用了)
gem sources -a https://gems.ruby-china.com/
执行完之后查看是否替换成功
gem sources -l
输出结果1
2*** CURRENT SOURCES *** https://gems.ruby-china.org/
说明替换成功
管理ruby的版本
1 |
|
Then install desired ruby
version:
1 |
|
Finally, either set installed ruby
in global, or local scope, or both:
1 |
|
Finally install bundler
gem:
1 |
|
重新安装安装 Jekyll 和 bundle gems
1 |
|
安装jekyll插件
gem install jekyll-gist jekyll-coffeescript jekyll-assets another-jekyll-plugin
安装完插件之后要重新执行bundle install
问题:
bundler: failed to load command: jekyll (/Users/longhe/.gem/bin/jekyll) <internal:/Users/longhe/.rbenv/versions/3.2.3/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require’: cannot load such file – webrick (LoadError)
解决:· bundle add webrick