<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Ruby China</title>
    <link>https://ruby-china.org/</link>
    <description>Ruby China社区最新发帖。</description>
    <language>en-us</language>
    <item>
      <title>Show Ruby China: 我用 Rails 8 开发的开源技术社区网站 MZFOSS</title>
      <description>&lt;p&gt;大家好！&lt;/p&gt;

&lt;p&gt;最近我用 Rails 8，开发了一个开源技术社区网站，用来追踪社区进展、技术观点与开发者正在讨论的高质量内容。&lt;/p&gt;

&lt;p&gt;经过 2 天的开发，网站基本上线了。&lt;/p&gt;

&lt;p&gt;网址：&lt;a href="https://mzfoss.com" rel="nofollow" target="_blank"&gt;https://mzfoss.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;如果你感兴趣，欢迎来看看。&lt;/p&gt;

&lt;p&gt;另外，社区投稿，可以领红包，欢迎投稿哦～～&lt;/p&gt;</description>
      <author>daqing</author>
      <pubDate>Sat, 04 Jul 2026 17:47:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/44608</link>
      <guid>https://ruby-china.org/topics/44608</guid>
    </item>
    <item>
      <title>写了一个 Ruby 框架来管理个人环境初始化脚本</title>
      <description>&lt;p&gt;已经两年没有逛 Ruby 社区了，抛弃 Ruby 语言也大概有两年之久了。现在重新捡起来，并开发了一个小项目 &lt;strong&gt;setup-env&lt;/strong&gt;，用来把个人环境初始化流程（tmux、zsh、dotfiles、开发工具等）写成可维护的 Ruby 脚本。&lt;/p&gt;

&lt;p&gt;仓库：&lt;a href="https://github.com/yetrun/setup-env" rel="nofollow" target="_blank"&gt;https://github.com/yetrun/setup-env&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="它解决什么问题"&gt;它解决什么问题&lt;/h3&gt;
&lt;p&gt;相信大家手里都攒了一堆初始化脚本，新机器/虚拟机来了就执行一遍。但脚本一多，常见问题就来了：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;中途失败不知道跑到哪，只能从头再来；&lt;/li&gt;
&lt;li&gt;已经装过的步骤重复执行，浪费时间，还可能覆盖配置；&lt;/li&gt;
&lt;li&gt;每个脚本都要自己处理代理、包管理器差异（apt/yum/brew）；&lt;/li&gt;
&lt;li&gt;Bash 写复杂流程、状态记录和交互越来越痛苦。&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="setup-env 的做法"&gt;setup-env 的做法&lt;/h3&gt;
&lt;p&gt;用 Ruby DSL 把初始化流程拆成一个个 &lt;code&gt;step&lt;/code&gt;，框架帮你记录状态：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;失败后支持重试、跳过、切换代理；&lt;/li&gt;
&lt;li&gt;已完成的步骤自动跳过；&lt;/li&gt;
&lt;li&gt;内置代理和包管理器差异处理；&lt;/li&gt;
&lt;li&gt;配合 Vagrant 做测试验证。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;仓库里的 scripts/ 是我的自用脚本和示例，大家可以参考写法，也可以 fork 后改成自己的初始化仓库。&lt;/p&gt;

&lt;p&gt;项目刚起步，欢迎试用、提 issue 或给建议 🙏&lt;/p&gt;</description>
      <author>yetrun</author>
      <pubDate>Sat, 04 Jul 2026 15:29:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/44607</link>
      <guid>https://ruby-china.org/topics/44607</guid>
    </item>
    <item>
      <title>怎么让 AI 写出更有 Rails 味的代码？</title>
      <description>&lt;p&gt;最近用 AI 写 Rails，发现它很喜欢按那种 controller -&amp;gt; service -&amp;gt; model 的方式组织代码。代码能跑，但是确实完全没有 Rails 的味道。&lt;/p&gt;

&lt;p&gt;经常上来就加 service，把 model 写得很贫血；concerns、mixin、Ruby 本身的一些顺手写法也不太会主动用。&lt;/p&gt;

&lt;p&gt;我想让 AI 写得更接近 Rails 传统那种 fat model、skinny controller 的感觉，不要动不动就分层分到很远。&lt;/p&gt;

&lt;p&gt;大家有类似经验吗？有没有 SKILL 可以推荐一下的。&lt;/p&gt;</description>
      <author>willx</author>
      <pubDate>Wed, 01 Jul 2026 13:04:05 +0800</pubDate>
      <link>https://ruby-china.org/topics/44606</link>
      <guid>https://ruby-china.org/topics/44606</guid>
    </item>
    <item>
      <title>头部跨境团队扩招，期待优秀的你</title>
      <description>&lt;p&gt;诚招想要从事电商行业的有心从事电商行业人士
借助于互联网和社交媒体的推广，赚取额外收入。
1 .我们提供全方位的网站服务和趋势性的产品线。&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;无囤货要求。&lt;/li&gt;
&lt;li&gt;经验人士和课程辅导。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;有意向可联系 wechat：ht0299999&lt;/p&gt;</description>
      <author>Farich</author>
      <pubDate>Wed, 01 Jul 2026 10:12:10 +0800</pubDate>
      <link>https://ruby-china.org/topics/44605</link>
      <guid>https://ruby-china.org/topics/44605</guid>
    </item>
    <item>
      <title>有没有招 Rails 远程 开发的</title>
      <description>&lt;p&gt;从事全栈（rails）开发有 8, 9 年了，可熟练使用 Redis、Sentry、Slack、Elasticsearch、Git、队列 (Sidekiq)、Docker 等。&lt;/p&gt;

&lt;p&gt;熟悉 TDD 流程，习惯编写 Rspec、Capybara 自动化测试，熟练构建 CI/CD 集成化部署。&lt;/p&gt;

&lt;p&gt;精通 react、vue、css、css3、stimulus、tailwind、next.js 等。&lt;/p&gt;

&lt;p&gt;对 CSS 有洁癖，可以高度还原 UI 设计。&lt;/p&gt;

&lt;p&gt;熟悉 webpack、vite 打包等。&lt;/p&gt;

&lt;p&gt;完成过 商城系统，商城 App，后台管理系统，社区杂志 等多种类系统。&lt;/p&gt;

&lt;p&gt;可以使用 ClaudeCode、OpenCode、Cursor、Trae 等进行 AI 辅助开发。&lt;/p&gt;

&lt;p&gt;可以做 Rails 开发，也可以做前端开发。&lt;/p&gt;</description>
      <author>eylu</author>
      <pubDate>Wed, 24 Jun 2026 15:43:25 +0800</pubDate>
      <link>https://ruby-china.org/topics/44602</link>
      <guid>https://ruby-china.org/topics/44602</guid>
    </item>
    <item>
      <title>一个仅 500 行 Ruby 代码的极简 Agent，支持 ReAct、Skill、MCP、异步压缩、持久化记忆、hooks、sandbox、安全审批等能力</title>
      <description>&lt;p&gt;Langdriver 是一个仅 500 行 Ruby 代码的极简 Agent：基于 ReAct 与 macOS 沙箱机制构建，针对 DeepSeek 进行了开箱即用的深度优化，全面兼容 DeepSeek 工具调用（tool-calls），支持 Skill、MCP、异步压缩、持久化记忆、hooks、sandbox、安全审批等能力。随着 LLM 能力的提升和 Skill 生态的扩展，LangDriver 的能力也会随之增强。
&lt;a href="https://github.com/kevin0x5/langdriver" rel="nofollow" target="_blank"&gt;https://github.com/kevin0x5/langdriver&lt;/a&gt;&lt;/p&gt;</description>
      <author>kkhaha</author>
      <pubDate>Fri, 19 Jun 2026 13:43:48 +0800</pubDate>
      <link>https://ruby-china.org/topics/44601</link>
      <guid>https://ruby-china.org/topics/44601</guid>
    </item>
    <item>
      <title>新书《Rails 8 现代单体架构实战》发布</title>
      <description>&lt;p&gt;2024 年，我在 RubyConf China 上做了《下一个十年的 Monolith》讲演：&lt;a href="https://www.bilibili.com/video/BV1R2cceWEvS" rel="nofollow" target="_blank"&gt;https://www.bilibili.com/video/BV1R2cceWEvS&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;但是大会一个主题的时间毕竟有限，所以感觉还有很多东西没有讲到或讲透，加上这两年里 Rails 8、8.1 的接连推出，让 Rails 在这个领域不断发展，我觉得有必要对这个主题——我称之为“现代单体架构（Modern Monolith）”——做一些更深入的阐述和探讨。&lt;/p&gt;

&lt;p&gt;因此，我决定写一本书。经过半年多的时间，这本书终于完成，正式发布在 Leanpub。&lt;/p&gt;

&lt;p&gt;购买链接：&lt;a href="https://leanpub.com/therails8modernmonolithinaction" rel="nofollow" target="_blank"&gt;https://leanpub.com/therails8modernmonolithinaction&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/apexy/12897218-ee7e-48c4-a545-55b7454132cb.png!large" title="" alt=""&gt;&lt;/p&gt;
&lt;h2 id="新书介绍"&gt;新书介绍&lt;/h2&gt;
&lt;p&gt;俗话说“天下大势，合久必分，分久必合”。&lt;/p&gt;

&lt;p&gt;对于 Web 应用来说，经过微服务、前后端分离的十多年流行之后，随着硬件和网络的进步，回归单体架构的趋势开始出现了。越来越多的开发者、团队或公司，都在逐渐认识到这一变化。&lt;/p&gt;

&lt;p&gt;Rails 8 通过一系列新特性，填平了旧时代单体架构面临的技术鸿沟，构筑起了现代单体架构（Modern Monolith）的新体系。&lt;/p&gt;

&lt;p&gt;阅读这本书，通过一个实际 Rails 应用的完整开发到上线的全过程，你将会深刻理解并掌握到：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rails 8 两种不同的现代单体架构（标准现代单体、组件驱动单体）的详细实战运用；&lt;/li&gt;
&lt;li&gt;从产品设计到部署上线的 Rails 应用产品的真实迭代开发流程全貌；&lt;/li&gt;
&lt;li&gt;涵盖测试金字塔、持续集成、持续部署、Storybook 等业界真正工业级的软件工程实践模式；&lt;/li&gt;
&lt;li&gt;各种 Ruby/Rails 开发的高级经验和技巧；&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;如果你热爱 Ruby，想了解 Rails 8 的最新特性，并且愿意看看现代单体架构如何实战落地，这本书就是为你写的。&lt;/p&gt;
&lt;h2 id="新书样章"&gt;新书样章&lt;/h2&gt;
&lt;p&gt;在 &lt;a href="https://leanpub.com/therails8modernmonolithinaction" rel="nofollow" target="_blank" title=""&gt;Leanpub 新书页面&lt;/a&gt;有新书试读样章可以直接免费下载。&lt;/p&gt;

&lt;p&gt;另外还有内容更多一些的社区版（Community Edition），可以通过邮件免费获取。&lt;/p&gt;
&lt;h2 id="社区折扣"&gt;社区折扣&lt;/h2&gt;
&lt;p&gt;既为了庆祝新书发布，也为了庆祝世界杯开赛，我为 Ruby China 社区准备了 20 个名额的五折优惠券。&lt;/p&gt;

&lt;p&gt;有兴趣的朋友可以私信联系我（备注 rubychina book）。&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/apexy/87874599-5d0a-44cf-afbc-4b1c61be7d8b.jpg!large" title="" alt=""&gt;&lt;/p&gt;
&lt;h2 id="【更新】"&gt;【更新】&lt;/h2&gt;
&lt;p&gt;社区五折名额已经用完了。非常感谢这些读者对本书的购买支持！&lt;/p&gt;

&lt;p&gt;不过社区用户依然可以微信联系我，我会对 RubyChina 用户给予九折优惠！&lt;/p&gt;</description>
      <author>apexy</author>
      <pubDate>Wed, 10 Jun 2026 11:50:47 +0800</pubDate>
      <link>https://ruby-china.org/topics/44597</link>
      <guid>https://ruby-china.org/topics/44597</guid>
    </item>
    <item>
      <title>使用 1password environments 来管理环境变量</title>
      <description>&lt;p&gt;最近的一个项目中，用了 1password environments 来管理环境变量，感觉还行，用起来比较简单。&lt;/p&gt;

&lt;p&gt;而且还支持 mount，修改之后，本地 mount 的文件自动也修改了。
&lt;img src="https://l.ruby-china.com/photo/ironboxer/4410d98c-3edb-48ab-9bc6-ffa9b2fae933.png!large" title="" alt=""&gt;
&lt;img src="https://l.ruby-china.com/photo/ironboxer/1a1f65d5-21c7-4bec-85bd-f81c7b3bdfec.png!large" title="" alt=""&gt;
&lt;img src="https://l.ruby-china.com/photo/ironboxer/87b34e21-07c7-4d96-9e98-d5e4c632c4ae.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>ironboxer</author>
      <pubDate>Tue, 09 Jun 2026 15:28:33 +0800</pubDate>
      <link>https://ruby-china.org/topics/44595</link>
      <guid>https://ruby-china.org/topics/44595</guid>
    </item>
    <item>
      <title>Ontology driven Agent：从“提示词工程（Prompt Engineering）”向“智能体软件工程（Agent Software Engineering）”</title>
      <description>&lt;p&gt;目前，我感觉全球的 agent 开发陷入了一个瓶颈期，虽然大家在做各种努力，但本质上仍然是提示词工程。&lt;/p&gt;

&lt;p&gt;我最近在看本体论，我发现将本体论（Ontology）加入到 agent 开发中来，能够彻底改变当前 agent 开发遇到的问题。&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;一、消除幻觉。提示词只能用自然语言“建议”模型去遵循规则，但 LLM 随时可能产生幻觉。本体论则是用严格的数据结构定义了业务的“物理法则”。&lt;/li&gt;
&lt;li&gt;二、动态能力路由与权限控制。当不同的用户或子 Agent 介入时，系统通过图谱查询动态计算出当前上下文应该拼装哪些 Tool 的 Schema，然后再转化为提示词发给模型。&lt;/li&gt;
&lt;li&gt;三、增强逻辑推理能力。通过推理机实现推理，而不是依赖于大语言模型。&lt;/li&gt;
&lt;li&gt;四、提示词无法可靠地控制复杂的先后顺序和错误恢复。本体定义了有向无环图 (DAG) 依赖关系，可以驱动工作流。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;还有：&lt;/p&gt;

&lt;p&gt;安全护栏、动态本体上下文裁剪、反思与自我纠错、分布式本体、多 agent、长期记忆、自适应演进、零代码 Agent、事件和时间、跨智能体协议、复杂任务、神经 - 符号混合推理等方面，在引入本体论后都有更优雅的实现方式。&lt;/p&gt;

&lt;p&gt;特别是：&lt;/p&gt;

&lt;p&gt;在编程 agent 中，将代码以某种形式本体化后，就可以实现代码、业务逻辑、开发流水线的有机融合，将会极大的提高编程 agent 的工程能力。&lt;/p&gt;

&lt;p&gt;另外补充：&lt;span class="embed-responsive embed-responsive-16by9"&gt;&lt;iframe class="embed-responsive-item" src="//player.bilibili.com/player.html?bvid=1ypVS6mETq" allowfullscreen=""&gt;&lt;/iframe&gt;&lt;/span&gt;/&lt;/p&gt;

&lt;p&gt;看了这个项目的解释视频（我也是看到这个视频的启发），虽然比较初步，但是可以看到将本体论引入编程 agent 的巨大潜力。&lt;/p&gt;</description>
      <author>shoushen</author>
      <pubDate>Fri, 05 Jun 2026 09:10:45 +0800</pubDate>
      <link>https://ruby-china.org/topics/44592</link>
      <guid>https://ruby-china.org/topics/44592</guid>
    </item>
    <item>
      <title>Ruby on Rails / DiscoursePluginEngineerRemote</title>
      <description>&lt;h2 id="About Us"&gt;About Us&lt;/h2&gt;
&lt;p&gt;Building next-gen AI developer community centered on knowledge sharing, collaboration &amp;amp; open innovation. Platform based on Discourse, iterated via custom plugins, AI modules, recommendation engine and developer tools. Hiring seasoned Ruby on Rails engineer specializing in Discourse plugin development.&lt;/p&gt;
&lt;h2 id="Responsibilities"&gt;Responsibilities&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Develop &amp;amp; maintain customized Discourse plugins&lt;/li&gt;
&lt;li&gt;Modify and expand Discourse core capabilities&lt;/li&gt;
&lt;li&gt;Construct new community functions and business workflows&lt;/li&gt;
&lt;li&gt;Connect third-party APIs and AI service interfaces&lt;/li&gt;
&lt;li&gt;Optimize system performance and expand platform scalability&lt;/li&gt;
&lt;li&gt;Diagnose and fix online production faults&lt;/li&gt;
&lt;li&gt;Cross-team cooperation with product &amp;amp; community teams&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="Requirements"&gt;Requirements&lt;/h2&gt;&lt;h3 id="Mandatory Qualifications"&gt;Mandatory Qualifications&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Solid Ruby on Rails development background&lt;/li&gt;
&lt;li&gt;Practical Discourse plugin development track record&lt;/li&gt;
&lt;li&gt;In-depth grasp of Discourse underlying architecture&lt;/li&gt;
&lt;li&gt;Proficiency in PostgreSQL, Redis&lt;/li&gt;
&lt;li&gt;Hands-on experience with Docker &amp;amp; Linux operation&lt;/li&gt;
&lt;li&gt;Skilled in Git and mainstream development processes&lt;/li&gt;
&lt;li&gt;Capable of reading English technical documents smoothly&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="Preferred Qualifications"&gt;Preferred Qualifications&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Operation experience of large-scale online communities&lt;/li&gt;
&lt;li&gt;Discourse Theme Components development experience&lt;/li&gt;
&lt;li&gt;Ember.js relevant knowledge&lt;/li&gt;
&lt;li&gt;Past integration work with AI/LLM APIs&lt;/li&gt;
&lt;li&gt;Open-source contribution history&lt;/li&gt;
&lt;li&gt;DevOps or cloud infrastructure experience&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="Personal Expectation for Candidates"&gt;Personal Expectation for Candidates&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Self-motivated, capable of independent work&lt;/li&gt;
&lt;li&gt;Enthusiastic about open source and developer community construction&lt;/li&gt;
&lt;li&gt;Excellent troubleshooting capability&lt;/li&gt;
&lt;li&gt;Focus on product quality and user experience&lt;/li&gt;
&lt;li&gt;Able to deliver deployable production code&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="Compensation Package"&gt;Compensation Package&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Competitive salary package&lt;/li&gt;
&lt;li&gt;100% remote working&lt;/li&gt;
&lt;li&gt;Flexible working schedule&lt;/li&gt;
&lt;li&gt;Long-term stable employment&lt;/li&gt;
&lt;li&gt;Equity option for top-performing hires&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="Application Materials &amp;amp; Submission"&gt;Application Materials &amp;amp; Submission&lt;/h2&gt;
&lt;p&gt;Required attachments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;GitHub homepage link&lt;/li&gt;
&lt;li&gt;Resume / LinkedIn profile&lt;/li&gt;
&lt;li&gt;Self-developed Discourse plugin samples&lt;/li&gt;
&lt;li&gt;Related project portfolio&lt;/li&gt;
&lt;li&gt;Expected salary range&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;tel&amp;amp;wechat:MTc1MjEyMTM5ODU=&lt;/p&gt;</description>
      <author>ninebeta</author>
      <pubDate>Wed, 03 Jun 2026 16:25:56 +0800</pubDate>
      <link>https://ruby-china.org/topics/44591</link>
      <guid>https://ruby-china.org/topics/44591</guid>
    </item>
    <item>
      <title>rails 项目里用 kamal 部署阿里云 ssl 证书流程总结</title>
      <description>&lt;h3 id="背景"&gt;背景&lt;/h3&gt;
&lt;p&gt;在我的部署过程中，有些域名总是无法成功自动申请 ssl 证书，暂时我也没搞清为什么无法自动申请成功，先尝试在阿里云申请 ssl 证书然后部署，现流程跑通特记录加深印象。&lt;/p&gt;
&lt;h2 id="以下是使用 Kamal 将阿里云SSL 证书自定义 部署的完整流程："&gt;以下是使用 Kamal 将阿里云 SSL 证书自定义 部署的完整流程：&lt;/h2&gt;&lt;h3 id="一、准备 SSL 证书文件"&gt;一、准备 SSL 证书文件&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;获取证书：从阿里云获取 SSL 证书

&lt;ul&gt;
&lt;li&gt;证书文件（ .pem）&lt;/li&gt;
&lt;li&gt;私钥文件（ .key）
&lt;img src="https://l.ruby-china.com/photo/flchenhp/12103573-a33c-4dfd-8520-03933d185fd1.png!large" title="" alt=""&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;注意：只需要申请主域名如 caibaoying.fun 的 ssl 证书，不需要同时申请 www.caibaoying.fun 的，我就踩了一次坑，哈哈。&lt;/p&gt;
&lt;h3 id="二、创建本地证书存储"&gt;二、创建本地证书存储&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;创建存放证书的文件夹和文件：&lt;/li&gt;
&lt;li&gt;config/ssl&lt;/li&gt;
&lt;li&gt;config/ssl/certificate.crt - 合并后的证书链&lt;/li&gt;
&lt;li&gt;config/ssl/private.key - 私钥文件
&lt;img src="https://l.ruby-china.com/photo/flchenhp/7b2708f5-c665-421b-b3fe-4020f3bc0f9f.png!large" title="" alt=""&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;将证书和私钥分别复制粘贴至文件内
&lt;img src="https://l.ruby-china.com/photo/flchenhp/45a71a11-fe44-4961-8bdb-c700a437309e.png!large" title="" alt=""&gt;&lt;/p&gt;
&lt;h3 id="三、配置 .kamal/secrets"&gt;三、配置 .kamal/secrets&lt;/h3&gt;
&lt;p&gt;在 .kamal/secrets 文件中添加环境变量定义：
&lt;img src="https://l.ruby-china.com/photo/flchenhp/a1c80e12-8ab9-47e3-baf9-80f601b0c63a.png!large" title="" alt=""&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CERTIFICATE_PEM=$(cat config/ssl/certificate.crt)
PRIVATE_KEY_PEM=$(cat config/ssl/private.key)
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="四、配置 config/deploy.yml"&gt;四、配置 config/deploy.yml&lt;/h3&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;proxy:
  ssl:
    certificate_pem: CERTIFICATE_PEM    # 对应 secrets 中的变量名
    private_key_pem: PRIVATE_KEY_PEM    # 对应 secrets 中的变量名
  hosts:
    - www.caibaoying.fun
    - caibaoying.fun
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="五、部署验证"&gt;五、部署验证&lt;/h3&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/kamal deploy
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="六、打开网页测试"&gt;六、打开网页测试&lt;/h3&gt;
&lt;p&gt;看到网站可以通过 https 方式安全打开，成功！
&lt;img src="https://l.ruby-china.com/photo/flchenhp/7f3f4416-7ef1-4944-8c18-7f57c47f6ffb.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>flchenhp</author>
      <pubDate>Wed, 03 Jun 2026 15:45:16 +0800</pubDate>
      <link>https://ruby-china.org/topics/44590</link>
      <guid>https://ruby-china.org/topics/44590</guid>
    </item>
    <item>
      <title>打听一个人 https://github.com/matzbot</title>
      <description>&lt;p&gt;who！&lt;/p&gt;</description>
      <author>zzz6519003</author>
      <pubDate>Wed, 03 Jun 2026 14:08:30 +0800</pubDate>
      <link>https://ruby-china.org/topics/44589</link>
      <guid>https://ruby-china.org/topics/44589</guid>
    </item>
    <item>
      <title>關於 spinel 的原理和侷限</title>
      <description>&lt;p&gt;今天和 claude 一起研究了一下 &lt;a href="https://github.com/matz/spinel" rel="nofollow" target="_blank"&gt;https://github.com/matz/spinel&lt;/a&gt; ，大概知道了它和別的靜態語言有什麼不同。&lt;/p&gt;

&lt;p&gt;spinel 的特點是需要對整個程序進行類型推斷，也就是一個方法的類型，實際上是由所有 call site 決定的。當看到一個方法調用的時候，分析器會把參數的類型記下來，然後把它疊到方法的定義上。例如一個方法&lt;code&gt;factorial(n)&lt;/code&gt;，當分析器看到&lt;code&gt;factorial(1)&lt;/code&gt; &lt;code&gt;factorial(2)&lt;/code&gt;的時候，它就知道 factorial 能接受 integer，如果整個程序都沒有傳別的類型，那麼它就能斷定 n 是 integer，然後可以輸出很高效的 c 代碼。但如果分析器之後看到 &lt;code&gt;factorial('1')&lt;/code&gt;，n 就會變成 integer | string，會需要額外處理多態，實際生成的 c 代碼就會包含這部分的處理。&lt;/p&gt;

&lt;p&gt;這樣做的後果是，整個程序如果變了一行，之前的推導就要全部重新來過，因為這個是基於&lt;strong&gt;整個程序&lt;/strong&gt;的推導。其他靜態語言由於會聲明函數的類型，推導對於函數體內和函數外是獨立的，因此一個函數在編譯了之後，如果簽名沒變就可以一直用，可以做到增量編譯。&lt;/p&gt;

&lt;p&gt;crystal 實際上也是用整個程序做推斷的，所以會有和 spinel 一樣的侷限，沒辦法做增量編譯。&lt;/p&gt;</description>
      <author>mizuhashi</author>
      <pubDate>Sat, 30 May 2026 05:20:38 +0800</pubDate>
      <link>https://ruby-china.org/topics/44588</link>
      <guid>https://ruby-china.org/topics/44588</guid>
    </item>
    <item>
      <title>用 Ruby 构建 AI Agent（更新第三篇：工具调用实践——网络搜索）</title>
      <description>&lt;p&gt;AI Agent（人工智能体）是指以 LLM（大语言模型）作为推理引擎，能够自主调用外部工具，规划并解决实际问题的程序。&lt;/p&gt;

&lt;p&gt;构建 AI Agent 已经成为目前最火热的开发领域。从构建通用 AI 助手，到传统应用引入 AI 功能，都需要用到构建 AI Agent 的知识。&lt;/p&gt;

&lt;p&gt;同时 AI Agent 又和传统软件有很大不同。传统软件需要程序员设计程序运转的完整流程，AI Agent 却要将思考外包给大语言模型，由大语言模型自主决定怎么做。构建 AI Agent 的过程，就好像给一个大脑安装五官和四肢。&lt;/p&gt;

&lt;p&gt;无论是为了业务需要，还是为了提升个人能力，学习构建 AI Agent 都会有所收益。&lt;/p&gt;
&lt;h2 id="为什么用 Ruby"&gt;为什么用 Ruby&lt;/h2&gt;
&lt;p&gt;在 LLM 训练领域，Ruby 可以说毫无存在感，那是 Python 和 C++ 的主场。构建 AI Agent 则回到了 Ruby 熟悉的领域——开发应用。&lt;/p&gt;

&lt;p&gt;AI Agent 最主要的两个操作是调用外部 API 和数据持久化，其实用什么语言开发都差不多。Ruby 的优势在于开发效率。&lt;/p&gt;

&lt;p&gt;下面是用 &lt;a href="https://rubyllm.com/" rel="nofollow" target="_blank" title=""&gt;RubyLLM&lt;/a&gt; 库调用大语言模型的最小例子：&lt;/p&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"ruby_llm"&lt;/span&gt;

&lt;span class="no"&gt;RubyLLM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ask&lt;/span&gt; &lt;span class="s2"&gt;"Hello!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ruby 社区追求优雅代码的传统让 LLM 的库比别的语言更精简。&lt;/p&gt;

&lt;p&gt;如果要为已有的 Ruby 应用添加 AI 功能，那么用同样的语言开发可以减少技术栈的复杂度。&lt;/p&gt;

&lt;p&gt;接下来我们会逐步学习如何构建 AI Agent。&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;目录：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://geeknote.net/Rei/posts/3288" rel="nofollow" target="_blank" title=""&gt;消息循环&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://geeknote.net/Rei/posts/3291" rel="nofollow" target="_blank" title=""&gt;工具调用&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://geeknote.net/Rei/posts/3294" rel="nofollow" target="_blank" title=""&gt;工具调用实践——网络搜索&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <author>Rei</author>
      <pubDate>Tue, 26 May 2026 23:20:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/44585</link>
      <guid>https://ruby-china.org/topics/44585</guid>
    </item>
    <item>
      <title>在 Reddit 上发了一个 Ruby Agent 开发的帖子有点火了</title>
      <description>&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/lyfi2003/e20b70b6-749f-4308-ba04-4a6bfaf1fefe.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.reddit.com/r/ruby/comments/1tnynx8/built_a_full_ai_agent_in_ruby_metaprogramming/" rel="nofollow" target="_blank"&gt;https://www.reddit.com/r/ruby/comments/1tnynx8/built_a_full_ai_agent_in_ruby_metaprogramming/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;大家有 reddit 账号的可以围观看下~ 另外，我们想在 hackernews 上也发一下但最近他们对账号有要求（要一直活跃才行），谁有合适的账号请求帮助啊&lt;/p&gt;</description>
      <author>lyfi2003</author>
      <pubDate>Tue, 26 May 2026 19:38:02 +0800</pubDate>
      <link>https://ruby-china.org/topics/44584</link>
      <guid>https://ruby-china.org/topics/44584</guid>
    </item>
    <item>
      <title>有没有用 rails+AI 做了审批流的功能模块或 gem，交流下经验</title>
      <description>&lt;p&gt;RT，感觉还可以
&lt;img src="https://l.ruby-china.com/photo/stephen/3bdeb57c-1d37-4e37-86f6-5bc6e8cad1c0.png!large" title="" alt=""&gt;&lt;/p&gt;</description>
      <author>stephen</author>
      <pubDate>Tue, 26 May 2026 08:03:42 +0800</pubDate>
      <link>https://ruby-china.org/topics/44583</link>
      <guid>https://ruby-china.org/topics/44583</guid>
    </item>
    <item>
      <title>最新的不一定好——预防供应链攻击</title>
      <description>&lt;p&gt;原文地址：&lt;a href="https://geeknote.net/Rei/posts/3286" rel="nofollow" target="_blank"&gt;https://geeknote.net/Rei/posts/3286&lt;/a&gt;&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;最近看到新闻，GitHub 疑似因员工 VS code 更新了被植入恶意代码的插件导致被入侵 (&lt;a href="https://news.ycombinator.com/item?id=48201316" rel="nofollow" target="_blank" title=""&gt;Hacker News&lt;/a&gt;) 。然后搜了一下，今年以来通过包管理器进行供应链攻击的案例已经有三起：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2026 年 3 月 axios npm 包攻击（&lt;a href="https://news.ycombinator.com/item?id=47582220" rel="nofollow" target="_blank" title=""&gt;Hacker News&lt;/a&gt;）&lt;/li&gt;
&lt;li&gt;2026 年 5 月 TanStack npm 包攻击（&lt;a href="https://news.ycombinator.com/item?id=48100706" rel="nofollow" target="_blank" title=""&gt;Hacker News&lt;/a&gt;）&lt;/li&gt;
&lt;li&gt;2026 年 5 月 VS Code 扩展供应链攻击（&lt;a href="https://news.ycombinator.com/item?id=48189368" rel="nofollow" target="_blank" title=""&gt;Hacker News&lt;/a&gt;）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;理论上，包的托管平台应该对新发布的包进行安全扫描，从源头杜绝恶意代码散布，但这个机制还没普及。当下在开发者一侧，可以给软件包更新加上冷却时间来降低风险。&lt;/p&gt;

&lt;p&gt;我搜集了我用到的包管理器的冷却设置记录如下，欢迎评论区补充。&lt;/p&gt;
&lt;h2 id="GitHub Dependabot"&gt;GitHub Dependabot&lt;/h2&gt;
&lt;p&gt;Dependabot 支持设置 cooldown 时间，配置：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- package-ecosystem: &amp;lt;name&amp;gt;
  cooldown:
    default-days: 7
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cooldown 选项仅适用于版本更新，不适用于安全更新。&lt;/p&gt;

&lt;p&gt;文档：&lt;a href="https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference#cooldown-" rel="nofollow" target="_blank"&gt;https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference#cooldown-&lt;/a&gt; 。&lt;/p&gt;
&lt;h2 id="NPM"&gt;NPM&lt;/h2&gt;
&lt;p&gt;NPM v11.10.0 以上可以设置 &lt;code&gt;min-release-age&lt;/code&gt;，命令：&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm config set min-release-age 7
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;文档：&lt;a href="https://docs.npmjs.com/cli/v11/using-npm/config#min-release-age" rel="nofollow" target="_blank"&gt;https://docs.npmjs.com/cli/v11/using-npm/config#min-release-age&lt;/a&gt; 。&lt;/p&gt;

&lt;p&gt;其他 js 包管理器也有类似机制。&lt;/p&gt;
&lt;h2 id="Bundler"&gt;Bundler&lt;/h2&gt;
&lt;p&gt;Bundler 还没支持 cooldown，但有一个讨论：&lt;a href="https://github.com/ruby/rubygems/discussions/9113" rel="nofollow" target="_blank"&gt;https://github.com/ruby/rubygems/discussions/9113&lt;/a&gt; 。&lt;/p&gt;
&lt;h2 id="编辑器"&gt;编辑器&lt;/h2&gt;&lt;h3 id="VS Code"&gt;VS Code&lt;/h3&gt;
&lt;p&gt;VS Code 可以关闭插件自动更新：&lt;/p&gt;

&lt;p&gt;&lt;img src="https://l.ruby-china.com/photo/Rei/1fcacdb6-08f3-412f-8dd1-9175c0ec57b1.png!large" title="" alt=""&gt;&lt;/p&gt;

&lt;p&gt;文档：&lt;a href="https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_extension-autoupdate" rel="nofollow" target="_blank"&gt;https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_extension-autoupdate&lt;/a&gt; 。&lt;/p&gt;
&lt;h3 id="Zed"&gt;Zed&lt;/h3&gt;
&lt;p&gt;Zed 还不支持关闭插件自动更新，但有一个讨论：&lt;a href="https://github.com/zed-industries/zed/discussions/38661" rel="nofollow" target="_blank"&gt;https://github.com/zed-industries/zed/discussions/38661&lt;/a&gt; 。&lt;/p&gt;</description>
      <author>Rei</author>
      <pubDate>Sun, 24 May 2026 17:01:04 +0800</pubDate>
      <link>https://ruby-china.org/topics/44581</link>
      <guid>https://ruby-china.org/topics/44581</guid>
    </item>
    <item>
      <title>[远程] Moonveil Entertainment — web3 游戏工作室招聘 AI+ 区块链 / 区块链全栈工程师</title>
      <description>&lt;p&gt;大家好
我们是 Moonveil Entertainment，一家 web3 游戏工作室。我们拥有多家知名风投的投资，其中包括 Gumi、HashKey、Animoca Brands。我们还拥有生态代币 $MORE，采用 Play-to-Airdrop 机制。我们正在为亚洲团队招聘，办公室位于新加坡。团队成员非常友好，大多来自 Riot Games、Tencent、Netease 和 Funplus&lt;/p&gt;

&lt;p&gt;我们正在招聘远程工作的 AI + 区块链全栈工程师（5 年以上经验）&lt;/p&gt;

&lt;p&gt;职责包括：&lt;/p&gt;

&lt;p&gt;• LLM 和 AI Agent 在 Web3 中的应用 — 开发区块链分析助手、自动交易策略、智能合约代码生成、Ai 安全审计、社群机器人（RAG、agent/function calling、LLM API 集成）&lt;/p&gt;

&lt;p&gt;• 区块链数据的机器学习 — 价格预测、异常检测、风险评估、欺诈监控、用户行为分析等模型&lt;/p&gt;

&lt;p&gt;• 区块链数据索引与处理 — 处理 Ethereum、Solana、BNB Chain、Polygon、HyperEVM 等公链数据（交易、事件、mempool）。构建 ETL 管道、数据清洗、存储（The Graph、Dune、Subgraph、ClickHouse、TimescaleDB、PostgreSQL）。开发自定义索引器和 WebSocket 实时流&lt;/p&gt;

&lt;p&gt;• Web3 后端 — 使用 Node.js / Python / Go / Rust 进行架构设计。集成钱包（Wagmi / Viem / Ethers.js / WalletConnect / RainbowKit）。处理交易（EIP-712、nonce 管理、Gas 估算）&lt;/p&gt;

&lt;p&gt;• 前端 — 使用 React / Vue / Next.js + Tailwind CSS 开发仪表盘、分析面板、交易信号和监控工具&lt;/p&gt;

&lt;p&gt;• 智能合约 — 使用 Solidity（Ethereum、BNB Chain、Polygon）和 Rust（solana）进行开发、测试和部署。Gas 优化、UUPS 代理、不变性测试和模糊测试&lt;/p&gt;

&lt;p&gt;• 预言机 — Chainlink、Pyth（包括 Pyth Entropy）、API3、Proof of Play&lt;/p&gt;

&lt;p&gt;要求：
• 5 年以上全栈 / Ai / web3 开发经验&lt;/p&gt;

&lt;p&gt;• 深入了解 ML、LLM、RAG、Ai Agent（针对 Ai 方向候选人）&lt;/p&gt;

&lt;p&gt;• 有区块链数据处理经验（索引、分析）&lt;/p&gt;

&lt;p&gt;• 必须精通 Solidity 智能合约开发，并有 Rust（solana）经验&lt;/p&gt;

&lt;p&gt;** 英语能力会是一个加分项！&lt;/p&gt;

&lt;p&gt;月薪范围：4000–8000 美元，具体金额面议&lt;/p&gt;

&lt;p&gt;** 我们也接受没有 AI 经验的候选人 — 普通区块链全栈开发者（solidity + Rust、索引、后端、前端）&lt;/p&gt;

&lt;p&gt;** 我们同时招聘全职和兼职（兼职每周 25-30 小时）&lt;/p&gt;

&lt;p&gt;您可以简单介绍一下自己，然后把简历发到我的 tg &lt;a href="/MekkaRetrico" class="user-mention" title="@MekkaRetrico"&gt;&lt;i&gt;@&lt;/i&gt;MekkaRetrico&lt;/a&gt; 或邮箱 mekkaji@163.com。请说明您是从哪里看到招聘信息的&lt;/p&gt;</description>
      <author>Mekka</author>
      <pubDate>Sat, 23 May 2026 23:09:06 +0800</pubDate>
      <link>https://ruby-china.org/topics/44580</link>
      <guid>https://ruby-china.org/topics/44580</guid>
    </item>
    <item>
      <title>讓 ActiveRecord model 只能在特定 service class 裏被更新</title>
      <description>&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Post&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;ApplicationRecord&lt;/span&gt;
  &lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;ActiveRecordReadOnly&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# Anywhere else in the codebase — blocked&lt;/span&gt;
&lt;span class="no"&gt;Post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;update!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;title: &lt;/span&gt;&lt;span class="s2"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# =&amp;gt; ActiveRecord::ReadOnlyRecord&lt;/span&gt;

&lt;span class="c1"&gt;# In a service class — allowed&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PostService&lt;/span&gt;
  &lt;span class="kp"&gt;include&lt;/span&gt; &lt;span class="no"&gt;Post&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Writable&lt;/span&gt;

  &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nc"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;published: &lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# works&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;實驗後發現這是可行的，可以通過在 model 的&lt;code&gt;readonly?&lt;/code&gt;方法裏檢查&lt;code&gt;caller_locations&lt;/code&gt;來判斷能否處在一個已經&lt;code&gt;include Post::Writable&lt;/code&gt;的環境，不過也有不少限制。&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/onyxblade/active_record_read_only" rel="nofollow" target="_blank"&gt;https://github.com/onyxblade/active_record_read_only&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just for fun&lt;/p&gt;</description>
      <author>mizuhashi</author>
      <pubDate>Fri, 22 May 2026 19:56:56 +0800</pubDate>
      <link>https://ruby-china.org/topics/44579</link>
      <guid>https://ruby-china.org/topics/44579</guid>
    </item>
    <item>
      <title>早说了转语言了身体却很诚实...</title>
      <description>&lt;h2 id="前情提要"&gt;前情提要&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://ruby-china.org/topics/26838" rel="nofollow" target="_blank"&gt;https://ruby-china.org/topics/26838&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;现在我们还有 Rails 项目呢，兜兜转转这么多年看到自己写的这个帖子...&lt;/p&gt;

&lt;p&gt;没有哪种技术能让我像对 Rails 和 Ruby 一样，长长的年头里，总是会忍不住在某个需求里面落地。&lt;/p&gt;

&lt;p&gt;Rails/Ruby to da moon!&lt;/p&gt;</description>
      <author>shawnyu</author>
      <pubDate>Fri, 22 May 2026 12:35:12 +0800</pubDate>
      <link>https://ruby-china.org/topics/44578</link>
      <guid>https://ruby-china.org/topics/44578</guid>
    </item>
  </channel>
</rss>
