# 安装主题 CLI 并创建主题

**URL:** https://meta.discourse.org/t/installing-theme-cli-and-creating-a-theme/394294
**Category:** Development
**Created:** [2026年一月25日 18:22 UTC](https://meta.discourse.org/t/installing-theme-cli-and-creating-a-theme/394294 "2026-01-25T18:22:35Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Andrew\_Rowe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andrew_rowe/32/445877_2.png) [@Andrew\_Rowe](https://meta.discourse.org/u/Andrew_Rowe)
#### Post date: [2026年一月25日 18:22 UTC](https://meta.discourse.org/t/installing-theme-cli-and-creating-a-theme/394294/1 "2026-01-25T18:22:35Z")

</div>

我不想让那个话题太乱，但我一直在遵循这个指南

> [@Theme Developer Tutorial: 2. Creating a remote theme](https://meta.discourse.org/t/theme-developer-tutorial-2-creating-a-remote-theme/357797?u=andrew_rowe):
>
> In the last chapter, we created a basic theme via the Discourse admin interface. This works well enough for very simple themes. But as soon as you want to do something more complex, or share a theme more widely, you’ll need to create a Remote Theme. Install the discourse\_theme CLI The first step towards developing a remote theme is to install the discourse\_theme CLI on your computer. This tool is used to generate the initial scaffold for a theme, and can then synchronize it in real-time to a lo…

当我进行到这一步时

> [@system](#):
>
> 设置完成后，您将看到 `✅ Done!`，并会提示您开始“监视”主题。回答是，然后完成监视设置。

我反而看到了

```plaintext
/var/lib/gems/3.0.0/gems/discourse_theme-2.1.6/lib/discourse_theme/scaffold.rb:53:in `block in generate': undefined method `safe_dump' for Psych:Module (NoMethodError)
Did you mean? safe_load
	from /var/lib/gems/3.0.0/gems/discourse_theme-2.1.6/lib/discourse_theme/scaffold.rb:18:in `chdir'
	from /var/lib/gems/3.0.0/gems/discourse_theme-2.1.6/lib/discourse_theme/scaffold.rb:18:in `generate'
	from /var/lib/gems/3.0.0/gems/discourse_theme-2.1.6/lib/discourse_theme/cli.rb:68:in `run'
	from /var/lib/gems/3.0.0/gems/discourse_theme-2.1.6/bin/discourse_theme:6:in `<top (required)>'
	from /usr/local/bin/discourse_theme:25:in `load'
	from /usr/local/bin/discourse_theme:25:in `<main>'

```

我做错什么了吗？

编辑：机器人说如果出现错误就安装 ruby-dev，这奏效了

---

_[View the full topic](https://meta.discourse.org/t/installing-theme-cli-and-creating-a-theme/394294)._
