Welcome to Jekyll!
jekyll (Theme) + Github Page
step0: install brew
step1: install ruby
why not
brew install ruby? macOS has a default ruby ❯ ruby -v ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin25]
Install chruby and ruby-install
brew install chruby ruby-install
ruby-install ruby 3.4.1
change default ruby to new download ruby
echo "source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh" >> ~/.zshrc echo "source $(brew --prefix)/opt/chruby/share/chruby/auto.sh" >> ~/.zshrc echo echo "chruby ruby-3.4.1" >> ~/.zshrc # run 'chruby' to see actual version
test version
❯ source ~/.zshrc
❯ ruby -v
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin25]
test gem
gem
RubyGems is a sophisticated package manager for Ruby. This is a
basic help message containing pointers to more information.
Usage:
gem -h/--help
gem -v/--version
gem command [arguments...] [options...]
Examples:
gem install rake
gem list --local
gem build package.gemspec
gem help install
Further help:
gem help commands list all 'gem' commands
gem help examples show some examples of usage
gem help gem_dependencies gem dependencies file guide
gem help platforms gem platforms guide
gem help <COMMAND> show help on COMMAND
(e.g. 'gem help install')
gem server present a web page at
http://localhost:8808/
with info about installed gems
Further information:
http://guides.rubygems.org
step2 install jekyll
gem install jekyll
Fetching webrick-1.9.1.gem
Fetching unicode-display_width-2.6.0.gem
Fetching terminal-table-3.0.2.gem
Fetching safe_yaml-1.0.5.gem
Fetching rouge-4.6.0.gem
Fetching forwardable-extended-2.6.0.gem
Fetching pathutil-0.16.2.gem
Fetching mercenary-0.4.0.gem
Fetching liquid-4.0.4.gem
Fetching kramdown-2.5.1.gem
Fetching kramdown-parser-gfm-1.1.0.gem
Fetching ffi-1.17.2-arm64-darwin.gem
Fetching rb-inotify-0.11.1.gem
Fetching rb-fsevent-0.11.2.gem
Fetching listen-3.9.0.gem
Fetching jekyll-watch-2.2.1.gem
Fetching google-protobuf-4.31.1-arm64-darwin.gem
Fetching sass-embedded-1.89.2-arm64-darwin.gem
Fetching jekyll-sass-converter-3.1.0.gem
Fetching concurrent-ruby-1.3.5.gem
Fetching i18n-1.14.7.gem
Fetching http_parser.rb-0.8.0.gem
Fetching eventmachine-1.2.7.gem
Fetching em-websocket-0.5.3.gem
Fetching jekyll-4.4.1.gem
Fetching colorator-1.1.0.gem
Fetching public_suffix-6.0.2.gem
Fetching addressable-2.8.7.gem
Successfully installed webrick-1.9.1
Successfully installed unicode-display_width-2.6.0
Successfully installed terminal-table-3.0.2
Successfully installed safe_yaml-1.0.5
Successfully installed rouge-4.6.0
Successfully installed forwardable-extended-2.6.0
Successfully installed pathutil-0.16.2
Successfully installed mercenary-0.4.0
Successfully installed liquid-4.0.4
Successfully installed kramdown-2.5.1
Successfully installed kramdown-parser-gfm-1.1.0
Successfully installed ffi-1.17.2-arm64-darwin
Successfully installed rb-inotify-0.11.1
Successfully installed rb-fsevent-0.11.2
Successfully installed listen-3.9.0
Successfully installed jekyll-watch-2.2.1
Successfully installed google-protobuf-4.31.1-arm64-darwin
Successfully installed sass-embedded-1.89.2-arm64-darwin
Successfully installed jekyll-sass-converter-3.1.0
Successfully installed concurrent-ruby-1.3.5
Successfully installed i18n-1.14.7
Building native extensions. This could take a while...
Successfully installed http_parser.rb-0.8.0
Building native extensions. This could take a while...
Successfully installed eventmachine-1.2.7
Successfully installed em-websocket-0.5.3
Successfully installed colorator-1.1.0
Successfully installed public_suffix-6.0.2
Successfully installed addressable-2.8.7
Successfully installed jekyll-4.4.1
28 gems installed
A new release of RubyGems is available: 3.6.2 → 3.7.1!
Run `gem update --system 3.7.1` to update your installation.
step3 install dependencies (already has jekyll)
gem install jekyll bundler
Successfully installed jekyll-4.4.1
Fetching bundler-2.7.1.gem
Successfully installed bundler-2.7.1
2 gems installed
create Gemfile to list your project’s dependencies
bundle init
Writing new Gemfile to /Users/elonnzhang/elonnzhang_github/elonnzhang.github.io/Gemfile
vim Gemfile
1 # frozen_string_literal: true
2
3 source "https://rubygems.org"
4
5 # gem "rails"
->
1 # frozen_string_literal: true
2
3 source "https://rubygems.org"
4
5 gem "jekyll"
Run bundle to install jekyll for your project.
❯ bundle
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Fetching rake 13.3.0
Installing rake 13.3.0
Fetching base64 0.3.0
Fetching json 2.13.2
Fetching csv 3.3.5
Fetching rexml 3.4.1
Fetching bigdecimal 3.2.2
Installing base64 0.3.0
Installing json 2.13.2 with native extensions
Installing csv 3.3.5
Installing rexml 3.4.1
Installing bigdecimal 3.2.2 with native extensions
Bundle complete! 1 Gemfile dependency, 35 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
step4 build and server
jekyll build
Configuration file: /Users/elonnzhang/elonnzhang_github/elonnzhang.github.io/_config.yml
Source: /Users/elonnzhang/elonnzhang_github/elonnzhang.github.io
Destination: /Users/elonnzhang/elonnzhang_github/elonnzhang.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.011 seconds.
Auto-regeneration: disabled. Use --watch to enable.
❯ jekyll serve
Configuration file: /Users/elonnzhang/elonnzhang_github/elonnzhang.github.io/_config.yml
Source: /Users/elonnzhang/elonnzhang_github/elonnzhang.github.io
Destination: /Users/elonnzhang/elonnzhang_github/elonnzhang.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.009 seconds.
/Users/elonnzhang/.gem/ruby/3.4.1/gems/listen-3.9.0/lib/listen.rb:3: warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add logger to your Gemfile or gemspec to silence this warning.
Auto-regeneration: enabled for '/Users/elonnzhang/elonnzhang_github/elonnzhang.github.io'
Server address: http://127.0.0.1:4000
Server running... press ctrl-c to stop.
[2025-08-01 22:28:14] ERROR '/favicon.ico' not found.
Regenerating: 1 file(s) changed at 2025-08-01 22:28:55
_posts/Hello.md.md
...done in 0.005608 seconds.
or
bundle exec jekyll s
_config.yaml 全局配置
theme: jekyll-theme-minimal
create a blog
create a markdown file in _posts
filename format YYYY-MM-DD-title.md
create a new page
http://127.0.0.1:4000/others/hello
create a new folder others,touch donate.md
---
layout: page
title: hello
---
Hello World!