<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://shirakawasanae.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://shirakawasanae.github.io/" rel="alternate" type="text/html" /><updated>2026-11-20T10:33:57+00:00</updated><id>https://shirakawasanae.github.io/feed.xml</id><title type="html">Jingwen’s Homepage</title><subtitle>Personal website of Jingwen.</subtitle><author><name>Jingwen Sun, 孙婧雯</name></author><entry><title type="html">OrangePi AI Pro 20T: 单节点 K3s Server 搭建记录</title><link href="https://shirakawasanae.github.io/blog/opi-k3s/" rel="alternate" type="text/html" title="OrangePi AI Pro 20T: 单节点 K3s Server 搭建记录" /><published>2026-09-14T00:00:00+00:00</published><updated>2026-09-14T00:00:00+00:00</updated><id>https://shirakawasanae.github.io/blog/opi-k3s</id><content type="html" xml:base="https://shirakawasanae.github.io/blog/opi-k3s/"><![CDATA[<h1 id="orangepi-ai-pro-20t-单节点-k3s-server">OrangePi AI Pro 20T 单节点 K3s Server</h1>

<blockquote>
  <p>状态：进行中。本文记录本次部署的命令、关键输出、配置决策和排查结果。
不记录 Wi-Fi 密码、SSH 私钥、K3s node token、kubeconfig 或其他凭据。</p>
</blockquote>

<h2 id="目标与边界">目标与边界</h2>

<ul>
  <li>节点：OrangePi AI Pro 20T，Ubuntu 22.04，aarch64。</li>
  <li>角色：单节点 <code class="language-plaintext highlighter-rouge">k3s server</code>（control plane、datastore、kubelet、container runtime 和普通工作负载均在此节点）。</li>
  <li>未来：另一块鲲鹏 OrangePi 作为 <code class="language-plaintext highlighter-rouge">k3s agent</code> 加入；两节点不是高可用集群。</li>
  <li>存储：当前根文件系统在 64 GB TF 卡；暂不运行模型训练或推理。后续接入 SSD 前不迁移 K3s 数据目录。</li>
  <li>NPU：<code class="language-plaintext highlighter-rouge">npu-smi</code> 存在持续硬件健康告警。本次仅搭建 CPU K3s，不安装 Ascend Device Plugin，也不将 NPU 暴露为 Kubernetes 可调度资源。</li>
</ul>

<h2 id="官方依据">官方依据</h2>

<ul>
  <li>K3s 支持 arm64/aarch64；server 基线为 2 CPU 核和 2 GB 内存。</li>
  <li>K3s server 需要对未来 agent 开放 TCP 6443；默认 Flannel VXLAN 需要节点间 UDP 8472；metrics-server 使用 TCP 10250。</li>
  <li>K3s 官方建议 ARM 设备使用 SSD，因为 etcd 对写入敏感；TF 卡仅用于当前学习阶段。</li>
  <li>单节点 K3s server 是可运行的完整 Kubernetes 集群；agent 将用 <code class="language-plaintext highlighter-rouge">K3S_URL</code> 和 <code class="language-plaintext highlighter-rouge">K3S_TOKEN</code> 注册。</li>
</ul>

<p>来源：</p>

<ul>
  <li>https://docs.k3s.io/quick-start</li>
  <li>https://docs.k3s.io/installation/requirements</li>
  <li>https://docs.k3s.io/cluster-access</li>
</ul>

<h2 id="预检日志">预检日志</h2>

<h3 id="2026-09-15网络现状">2026-09-15：网络现状</h3>

<p>执行（只读）：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli connection show <span class="nt">--active</span>
</code></pre></div></div>

<p>关键输出：</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>NAME      TYPE    DEVICE
nhpcc702  wifi    wlan0
docker0   bridge  docker0
</code></pre></div></div>

<p>执行（只读）：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli device show wlan0
</code></pre></div></div>

<p>关键输出：</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>GENERAL.STATE: connected
GENERAL.CONNECTION: nhpcc702
IP4.ADDRESS[1]: 192.168.50.250/24
IP4.GATEWAY: 192.168.50.1
IP4.DNS[1]: 202.38.64.17
IP4.DNS[2]: 192.168.50.1
</code></pre></div></div>

<p>执行（只读）：</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nmcli connection show nhpcc702
</code></pre></div></div>

<p>关键输出：</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>connection.autoconnect: yes
ipv4.method: auto
DHCP4.OPTION: dhcp_lease_time = 86400
DHCP4.OPTION: dhcp_server_identifier = 192.168.50.1
DHCP4.OPTION: ip_address = 192.168.50.250
</code></pre></div></div>

<p>结论：当前 Wi-Fi 由 DHCP 分配地址。由于无法从开发板读取路由器 DHCP 地址池，本次若将主机改为静态地址，会沿用当前的 <code class="language-plaintext highlighter-rouge">192.168.50.250/24</code>、网关 <code class="language-plaintext highlighter-rouge">192.168.50.1</code> 和当前 DNS。后续应在路由器中按 Wi-Fi MAC 做 DHCP 保留，以避免潜在地址冲突。</p>

<h2 id="变更日志">变更日志</h2>

<p>尚未开始系统变更。</p>

<h2 id="checkpoint-2026-09-15-1552-cst">Checkpoint: 2026-09-15 15:52 CST</h2>

<p>Completed and persistent on the board:</p>

<div class="language-text highlighter-rouge"><div class="highlight"><pre class="highlight"><code>K3s: v1.36.4+k3s1; enabled system service; node Ready/control-plane
Node IP: 192.168.50.250 (static Wi-Fi)
NetworkManager fallback: nhpcc702-dhcp-backup (autoconnect disabled)
Registry config: /etc/rancher/k3s/registries.yaml
Docker Hub mirror: https://docker.m.daocloud.io
Kubelet cgroup-v1 compatibility file:
  /var/lib/rancher/k3s/agent/etc/kubelet.conf.d/10-cgroup-v1-compat.conf
</code></pre></div></div>

<p>Direct Docker Hub access timed out. The configured mirror passed an OCI Registry v2 connectivity check. After the K3s restart, CoreDNS, local-path-provisioner, and metrics-server were Running. The two Traefik Helm install jobs were still pulling their images when this checkpoint was saved.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Check after the next boot.</span>
<span class="nb">sudo </span>systemctl is-active k3s
<span class="nb">sudo </span>k3s kubectl get nodes <span class="nt">-o</span> wide
<span class="nb">sudo </span>k3s kubectl get pods <span class="nt">-A</span>

<span class="c"># Clean shutdown; keep the 64 GB TF card inserted.</span>
<span class="nb">sudo </span>poweroff
</code></pre></div></div>

<p>No NPU device plugin was installed. The temporary Codex sudo authorization was removed after deployment.</p>]]></content><author><name>Jingwen Sun, 孙婧雯</name></author><category term="orangepi" /><category term="k3s" /><category term="kubernetes" /><category term="arm64" /><summary type="html"><![CDATA[OrangePi AI Pro 20T 单节点 K3s Server]]></summary></entry><entry><title type="html">Beloved Books</title><link href="https://shirakawasanae.github.io/blog/reading/e-books/" rel="alternate" type="text/html" title="Beloved Books" /><published>2026-08-17T09:30:00+00:00</published><updated>2026-08-17T09:30:00+00:00</updated><id>https://shirakawasanae.github.io/blog/reading/book-links</id><content type="html" xml:base="https://shirakawasanae.github.io/blog/reading/e-books/"><![CDATA[<!--more-->

<ul>
  <li><a href="/docs/%E4%B8%AD%E6%96%87%E6%89%93%E5%AD%97%E6%9C%BA%EF%BC%9A%E4%B8%80%E4%B8%AA%E4%B8%96%E7%BA%AA%E7%9A%84%E6%B1%89%E5%AD%97%E7%AA%81%E5%9B%B4%E5%8F%B2.pdf">中文打字机：一个世纪的汉字突围史（[美]墨磊宁)</a></li>
  <li><a href="/docs/%E7%B2%BE%E7%A5%9E%E7%A7%91%E8%8D%AF%E7%89%A9%E4%B8%B4%E5%BA%8A%E6%89%8B%E5%86%8CClinical%20Handbook%20of%20Psychotropic%20Drugs%20%E7%AC%AC21%E7%89%88.pdf">Clinical Handbook of Psychotropic Drugs 21st edition</a></li>
  <li><a href="https://infrasys-ai.github.io/aisystem-docs/01Introduction/README.html">ZOMI 的 AI System 讲义</a></li>
  <li><a href="https://infrasys-ai.github.io/aiinfra-docs/00Summary/README.html">ZOMI 的 AI Infra 讲义</a></li>
  <li><a href="https://openmlsys.github.io/v1/cn/index.html">OpenMLSys 机器学习系统：设计和实现</a></li>
  <li><a href="https://vizuaraai.github.io/5d-parallelism-visual-guide/index.html">5D 并行可视化页面 - 2026</a></li>
  <li><a href="https://spaces.ac.cn/author/1/1/">苏剑林的科学空间</a></li>
  <li><a href="https://bbycroft.net/llm">LLM Visualization - 2023~2026</a></li>
  <li><a href="https://poloclub.github.io/transformer-explainer/">Transformer Explainer - 2024~2026</a></li>
  <li><a href="https://learnxinyminutes.com/zh-cn/">Y 分钟学会 X</a></li>
  <li><a href=""></a></li>
</ul>]]></content><author><name>Jingwen Sun, 孙婧雯</name></author><category term="reading" /><category term="reading" /><category term="books" /><category term="guides" /><category term="interests" /><summary type="html"><![CDATA[in the form of e-books]]></summary></entry><entry><title type="html">本科编译原理课程资料</title><link href="https://shirakawasanae.github.io/blog/building/compiler-sources/" rel="alternate" type="text/html" title="本科编译原理课程资料" /><published>2026-08-17T09:30:00+00:00</published><updated>2026-08-17T09:30:00+00:00</updated><id>https://shirakawasanae.github.io/blog/building/compiler-class</id><content type="html" xml:base="https://shirakawasanae.github.io/blog/building/compiler-sources/"><![CDATA[<!--more-->

<ul>
  <li><a href="/docs/%E7%AC%AC%E4%B8%80%E6%AC%A1%E4%B9%A0%E9%A2%98%E8%AF%BEHW1-3.pdf">25秋 HW1~3</a></li>
  <li><a href="/docs/011163_25FA_HW5-1_ANSWER.pdf">25秋 HW5 part1</a></li>
  <li><a href="/docs/011163_25FA_HW5-2_ANSWER.pdf">25秋 HW5 part2</a></li>
  <li><a href="/docs/%E7%BC%96%E8%AF%91%E5%8E%9F%E7%90%86%E4%B9%A0%E9%A2%98%E7%B2%BE%E9%80%89%E4%B8%8E%E8%A7%A3%E6%9E%90-%E7%AC%AC3%E7%89%88.pdf">习题精选 陈意云，张昱 著</a></li>
  <li><a href="/docs/%E5%A6%82%E4%BD%95%E5%9C%A8%E5%B8%8C%E5%86%80%E5%B9%B3%E5%8F%B0%E5%88%B6%E4%BD%9C%E8%AF%84%E6%B5%8B%E6%9C%BA%E4%BB%A5%E5%8F%8A%E6%B5%8B%E8%AF%84%E9%A2%98.pdf">25秋 助教用 希冀平台评测使用说明</a></li>
  <li><a href=""></a></li>
  <li><a href=""></a></li>
  <li><a href=""></a></li>
  <li><a href=""></a></li>
  <li><a href=""></a></li>
  <li><a href=""></a></li>
  <li><a href=""></a></li>
</ul>]]></content><author><name>Jingwen Sun, 孙婧雯</name></author><category term="building" /><category term="USTC" /><category term="compiler class" /><category term="TA" /><summary type="html"><![CDATA[]]></summary></entry><entry><title type="html">用 Jekyll 搭建自己的 GitHub 个人主页</title><link href="https://shirakawasanae.github.io/blog/building/jekyll-github-pages/" rel="alternate" type="text/html" title="用 Jekyll 搭建自己的 GitHub 个人主页" /><published>2026-08-15T02:30:00+00:00</published><updated>2026-08-15T02:30:00+00:00</updated><id>https://shirakawasanae.github.io/blog/building/jekyll-github-pages-guide</id><content type="html" xml:base="https://shirakawasanae.github.io/blog/building/jekyll-github-pages/"><![CDATA[<p>GitHub Pages 适合托管不需要后端的个人主页：内容保存在 Git 仓库，推送后由 GitHub 构建并发布。本篇以一个使用 <a href="https://github.com/mmistakes/minimal-mistakes">Minimal Mistakes</a> 远程主题的 Jekyll 站点为例，整理从本地环境到部署、再到样式定制的完整流程。</p>

<!--more-->

<h3 id="珠玉在前">珠玉在前</h3>

<p>直接利用 GitHub Pages 或者 clone 别人的仓库搭建主页，是一种很方便的方式，有许多博客珠玉在前：</p>
<ul>
  <li><a href="https://zhuanlan.zhihu.com/p/711554540">使用github.io制作你的个人学术主页-知乎</a></li>
  <li><a href="https://classicalqy.github.io/website_building/">如何用Github Pages搭建自己的个人网站？- Qiyu Chen</a></li>
</ul>

<p>此处记录的则是我先用 Codex + Ruby 在本地搭建 jekyll 框架，再通过 <code class="language-plaintext highlighter-rouge">git remote add</code> 连接远程仓库，再推送上去得到个人主页的步骤。我的 prompt:</p>

<blockquote>
  <p>i want to build a personal homepage based on Jekyll(Github) minimal mistake, academic style, including main homepage(About Me + Research Intrest + Publications + Projects + one picture of me), blog(which i can set as private or public and update), friend-link. Can you help me build my homepage under ‘homepage’ workspace?  I know i should create a repo on my github and push my homepage, so you can just help me clone and build and edit and beautify locally, i’ll commit and push by myself.</p>
</blockquote>

<h3 id="推荐版本">推荐版本</h3>

<p>一个 Jekyll 主页通常有三层依赖，分别由不同工具处理：</p>

<ol>
  <li><strong>运行时</strong>：Ruby、RubyGems 和 Bundler 在本地运行 Jekyll。</li>
  <li><strong>站点依赖</strong>：<code class="language-plaintext highlighter-rouge">Gemfile</code> 中的 gem，例如 <code class="language-plaintext highlighter-rouge">github-pages</code>、<code class="language-plaintext highlighter-rouge">webrick</code>。<code class="language-plaintext highlighter-rouge">vendor/bundle</code> 是 Bundler 在本地缓存 Ruby gem 的目录；它不会替 GitHub Pages 下载远程主题，也不应提交到 Git 仓库。如果搭建主页时本地用了 <code class="language-plaintext highlighter-rouge">vendor/bundle</code>，GitHub Action 很可能会报错并推荐你改为远程主题。</li>
  <li><strong>主题与配置</strong>：<code class="language-plaintext highlighter-rouge">_config.yml</code> 选择主题、插件和 URL；CSS 和 SCSS 则负责覆盖主题的视觉样式。</li>
</ol>

<p>本仓库建议使用 <strong>Ruby 3.3.x</strong>，这是为了让本地环境与本项目的 GitHub Pages 依赖组合保持稳定，防止更高的版本不支持 csv， 并不是所有 Jekyll 项目的通用上限。我先后尝试了 Ruby 4.0 -&gt; 3.4 -&gt; 3.3，认为 <strong>Ruby 3.3</strong> 是最好的。</p>

<p>Windows 用户推荐安装带 MSYS2 DevKit 的 <a href="https://rubyinstaller.org/">RubyInstaller</a>。DevKit 能在某些 gem 需要本地编译扩展时提供编译工具。Installer 提供了便捷安装和 PATH 配置，下载好之后双击启动 Ruby 的安装，安装时一路 Next 即可。也可以通过命令行安装：</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">winget</span><span class="w"> </span><span class="nx">install</span><span class="w"> </span><span class="nt">--exact</span><span class="w"> </span><span class="nt">--id</span><span class="w"> </span><span class="nx">RubyInstallerTeam.RubyWithDevKit.3.3</span><span class="w"> </span><span class="nt">--source</span><span class="w"> </span><span class="nx">winget</span><span class="w"> </span><span class="nt">--accept-package-agreements</span><span class="w"> </span><span class="nt">--accept-source-agreements</span><span class="w">
</span></code></pre></div></div>

<p>安装后重启终端，确认版本：</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">ruby</span><span class="w"> </span><span class="nt">--version</span><span class="w">
</span><span class="n">gem</span><span class="w"> </span><span class="nt">--version</span><span class="w">
</span></code></pre></div></div>

<p>有正常输出代表已经安装完毕，且 PATH 配置好。</p>

<h3 id="gemfile-应该包含什么">Gemfile 应该包含什么</h3>

<p>一个使用 GitHub Pages 和远程主题的最小 <code class="language-plaintext highlighter-rouge">Gemfile</code> 可以是：</p>

<div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">source</span> <span class="s2">"https://rubygems.org"</span>

<span class="n">gem</span> <span class="s2">"github-pages"</span><span class="p">,</span> <span class="ss">group: :jekyll_plugins</span>
<span class="n">gem</span> <span class="s2">"webrick"</span><span class="p">,</span> <span class="s2">"~&gt; 1.8"</span>
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">github-pages</code> 让本地 Jekyll 依赖尽量贴近 GitHub Pages 的构建环境，并带来 Pages 支持的插件。<code class="language-plaintext highlighter-rouge">webrick</code> 只用于本地启动开发服务器。主题的远程下载由 <code class="language-plaintext highlighter-rouge">jekyll-remote-theme</code> 处理，它应列在 <code class="language-plaintext highlighter-rouge">_config.yml</code> 的 <code class="language-plaintext highlighter-rouge">plugins</code> 中。</p>

<p>如果使用 <code class="language-plaintext highlighter-rouge">remote_theme</code>，不要同时为了同一个主题再添加 <code class="language-plaintext highlighter-rouge">minimal-mistakes-jekyll</code> 这类本地主题 gem。两种安装模式混用容易让 Bundler 的约束与 GitHub Pages 的预装依赖发生冲突。选择一种模式并保持配置一致。</p>

<h2 id="从零到本地预览">从零到本地预览</h2>

<p>现在，假定我们已经安装好 Ruby 和 gem，并且本地拥有一个包含 <code class="language-plaintext highlighter-rouge">Gemfile</code> <code class="language-plaintext highlighter-rouge">index.md</code> <code class="language-plaintext highlighter-rouge">_config.yml</code> 等必要结构的 jekyll 克隆仓库或手动仓库（我是直接让 Codex 拉取并搭建的框架）。在仓库目录下打开命令行安装 bundler：</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">gem</span><span class="w"> </span><span class="nx">install</span><span class="w"> </span><span class="nx">bundler</span><span class="w">
</span><span class="n">bundle</span><span class="w"> </span><span class="nt">--version</span><span class="w">
</span><span class="n">bundle</span><span class="w"> </span><span class="nx">install</span><span class="w">
</span><span class="n">bundle</span><span class="w"> </span><span class="nx">exec</span><span class="w"> </span><span class="nx">jekyll</span><span class="w"> </span><span class="nx">serve</span><span class="w">
</span></code></pre></div></div>
<p>这里的最后一行命令就是开启本地预览，打开 <code class="language-plaintext highlighter-rouge">http://localhost:4000</code> 查看网站。<code class="language-plaintext highlighter-rouge">--livereload</code> 会在保存 Markdown、YAML 或 SCSS 后自动刷新浏览器；如果它在本机不可用，去掉该参数即可。<code class="language-plaintext highlighter-rouge">--trace</code> 会追踪网页日志。</p>

<h2 id="配置-github-pages-与远程主题">配置 GitHub Pages 与远程主题</h2>

<p>对于用户主页仓库，仓库名应为 <code class="language-plaintext highlighter-rouge">USERNAME.github.io</code>。在 <code class="language-plaintext highlighter-rouge">_config.yml</code> 中设置站点 URL、仓库名和主题：</p>

<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">url</span><span class="pi">:</span> <span class="s2">"</span><span class="s">https://USERNAME.github.io"</span>
<span class="na">baseurl</span><span class="pi">:</span> <span class="s2">"</span><span class="s">"</span>
<span class="na">repository</span><span class="pi">:</span> <span class="s2">"</span><span class="s">USERNAME/USERNAME.github.io"</span>

<span class="na">remote_theme</span><span class="pi">:</span> <span class="s2">"</span><span class="s">mmistakes/minimal-mistakes@4.24.0"</span>

<span class="na">plugins</span><span class="pi">:</span>
  <span class="pi">-</span> <span class="s">jekyll-remote-theme</span>
  <span class="pi">-</span> <span class="s">jekyll-feed</span>
  <span class="pi">-</span> <span class="s">jekyll-include-cache</span>
  <span class="pi">-</span> <span class="s">jekyll-sitemap</span>
</code></pre></div></div>

<p>远程主题中的版本必须是上游真实存在的 Git tag。Minimal Mistakes 的这个标签写作 <code class="language-plaintext highlighter-rouge">4.24.0</code>，而不是 <code class="language-plaintext highlighter-rouge">v4.24.0</code>。标签写错时，GitHub Pages 会在下载 <code class="language-plaintext highlighter-rouge">codeload.github.com</code> 的主题压缩包时返回 404，导致整个构建失败。另外，GitHub Action 不接受本地主题（即使 vendor 预览成功），Action 会自动远程拉取主题，所以上述 plugins 和 <code class="language-plaintext highlighter-rouge">remote_theme</code> 是不可或缺的。</p>

<p>在 GitHub 仓库的 <code class="language-plaintext highlighter-rouge">Settings -&gt; Pages</code> 中，选择 <code class="language-plaintext highlighter-rouge">Deploy from a branch</code>，再选择 <code class="language-plaintext highlighter-rouge">main</code> 或其他分支和 <code class="language-plaintext highlighter-rouge">/(root)</code>。这项设置只需配置一次；以后每次推送到该分支都会触发重新发布。也可以改用 GitHub Actions，但那意味着要自行维护构建工作流和依赖版本。<a href="https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site">GitHub Pages 发布源文档</a> 说明了两种方式的区别。</p>

<h2 id="提交与发布">提交与发布</h2>

<p>本地预览确认无误后，提交并推送到 Pages 的发布分支：</p>

<div class="language-powershell highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">git</span><span class="w"> </span><span class="nx">remote</span><span class="w"> </span><span class="nx">add</span><span class="w"> </span><span class="nx">https://github.com/</span><span class="p">[</span><span class="n">username</span><span class="p">]</span><span class="nx">/</span><span class="p">[</span><span class="n">username</span><span class="p">]</span><span class="o">.</span><span class="nf">github</span><span class="o">.</span><span class="nf">io</span><span class="o">.</span><span class="nf">git</span><span class="w">
</span><span class="nx">git</span><span class="w"> </span><span class="nx">status</span><span class="w">
</span><span class="n">git</span><span class="w"> </span><span class="nx">add</span><span class="w"> </span><span class="nx">xxx</span><span class="w">
</span><span class="n">git</span><span class="w"> </span><span class="nx">commit</span><span class="w"> </span><span class="nt">-m</span><span class="w"> </span><span class="s2">"xxx"</span><span class="w">
</span><span class="n">git</span><span class="w"> </span><span class="nx">push</span><span class="w"> </span><span class="nx">origin</span><span class="w"> </span><span class="p">[</span><span class="n">your</span><span class="w"> </span><span class="n">deploy</span><span class="nt">-page</span><span class="w"> </span><span class="n">branch</span><span class="p">]</span><span class="w">
</span></code></pre></div></div>
<p>如果还改了样式或站点配置，再有针对性地把 <code class="language-plaintext highlighter-rouge">assets/css/main.scss</code>、<code class="language-plaintext highlighter-rouge">_config.yml</code> 或 <code class="language-plaintext highlighter-rouge">Gemfile</code> 加入暂存区。</p>

<p>推送后在仓库的 <code class="language-plaintext highlighter-rouge">Actions</code> 页面查看部署状态。构建完成后，访客访问的就是发布分支中 <code class="language-plaintext highlighter-rouge">/(root)</code> 的最新版本。首次发布或依赖下载较慢时，等待几分钟再刷新页面。</p>

<h2 id="常见问题与排查">常见问题与排查</h2>

<table>
  <thead>
    <tr>
      <th>现象</th>
      <th>原因</th>
      <th>处理方式</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">bundle</code> 不是命令</td>
      <td>Ruby 或 Bundler 没有安装，或终端没有刷新 <code class="language-plaintext highlighter-rouge">PATH</code></td>
      <td>重开终端，执行 <code class="language-plaintext highlighter-rouge">ruby --version</code>，再运行 <code class="language-plaintext highlighter-rouge">gem install bundler</code>。</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">Bundler can't satisfy your Gemfile's dependencies</code></td>
      <td>本地主题 gem、远程主题和 <code class="language-plaintext highlighter-rouge">github-pages</code> 的版本约束混在一起</td>
      <td>选择一种主题模式。远程主题项目保留 <code class="language-plaintext highlighter-rouge">github-pages</code> 和 <code class="language-plaintext highlighter-rouge">_config.yml</code> 中的 <code class="language-plaintext highlighter-rouge">remote_theme</code>，不要再为同一主题安装本地 gem。</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">404 ... codeload.github.com/.../zip/v4.24.0</code></td>
      <td><code class="language-plaintext highlighter-rouge">remote_theme</code> 的 tag 不存在</td>
      <td>到主题仓库的 Releases 或 Tags 页面核对标签；此例应写成 <code class="language-plaintext highlighter-rouge">@4.24.0</code>。</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">vendor/bundle</code> 已存在但 Pages 仍报主题下载错误</td>
      <td><code class="language-plaintext highlighter-rouge">vendor/bundle</code> 只在本机缓存 Bundler 安装的 gem；GitHub Pages 使用自己的干净构建环境</td>
      <td>不提交 <code class="language-plaintext highlighter-rouge">vendor/</code>。检查远程主题地址、tag 和 <code class="language-plaintext highlighter-rouge">_config.yml</code> 插件列表。</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">Invalid username or token</code></td>
      <td>GitHub 已不支持用账号密码进行 HTTPS Git 推送，或旧令牌被缓存</td>
      <td>使用 Git Credential Manager 浏览器授权，或使用有仓库写入权限的 Personal Access Token。</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">Failed to connect to github.com port 443</code></td>
      <td>网络、防火墙、代理或 VPN 无法连接 GitHub</td>
      <td>先恢复 HTTPS 连通性，再重试推送；认证错误和网络错误要分别处理。</td>
    </tr>
  </tbody>
</table>

<p>一个稳定的工作流很简单：内容和样式在本地修改，Jekyll 预览，Git 提交，推送到发布分支，再由 GitHub Pages 自动部署。把依赖模式保持单一、把本地生成目录排除在版本控制外，就能少掉大部分环境问题。</p>]]></content><author><name>Jingwen Sun, 孙婧雯</name></author><category term="building" /><category term="jekyll" /><category term="github-pages" /><category term="ruby" /><category term="scss" /><summary type="html"><![CDATA[从 Ruby + Codex 到 GitHub Pages 与常见构建错误记录。]]></summary></entry></feed>