# 设置 Discourse 开发环境指南 - Windows 11

**URL:** <https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227>\
**Category:** Self-hosting\
**Tags:** dev-install\
**Created:** [2023年十月14日 10:38 UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227 "2023-10-14T10:38:25Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![afovos](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/afovos/32/518166_2.png) [@afovos](https://meta.discourse.org/u/afovos)\
**Post date:** [2025年八月19日 14:35 UTC](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227/16 "2025-08-19T14:35:47Z")

</div>

您好 👋，我正在 Windows 11 下使用 WSL2，并遵循了这篇帖子中的步骤来安装本地 Discourse 开发实例。我遇到了一些问题，但最终都解决了。以下是我的发现：

（起初我尝试使用 **ubuntu-20.04** ，但遇到了缺少 **libwebp7** 依赖项的问题，这是 ImageMagick 安装所必需的。似乎 libwebp7 不适用于 ubuntu-20.04）➡ 因此，我决定改用 **ubuntu-22.04** ，这对我有用。

遵循开篇帖子中 @AliBenBongo 的指南，第 9 步之前的一切都按预期工作。👍

在 **第 9 步** 中，需要进行一些更改

> [@AliBenBongo](#):
>
> 1. 现在复制并粘贴以下单行安装脚本来设置开发环境。根据您的计算机和/或互联网连接的速度，这可能需要一些时间才能完成，所以去喝杯咖啡什么的！
> 
> ```plaintext
> bash <(wget -qO- https://raw.githubusercontent.com/discourse/install-rails/master/linux)
> 
> ```

[https://raw.githubusercontent.com/discourse/install-rails/master/linux](https://raw.githubusercontent.com/discourse/install-rails/master/linux) 中的一些资源似乎已过时：

- 我不得不安装 Ruby 3.3.x 而不是 3.2.1，通过将 `ruby_version=“3.2.1”` 更改为 `ruby_version=“3.3.9”`
- 我不得不安装 Node 20 而不是 18，通过将 `curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -` 更改为 `curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -`

在 **第 15 步** 中，您需要运行 `pnpm install` 而不是 `yarn install`

然后，在 **第 16 步** 运行迁移时，它因某些依赖于 `pgvector` Postgres 扩展的迁移而抛出错误。所以我遵循了这里的 Linux 安装指南：[https://github.com/pgvector/pgvector/blob/master/README.md](https://github.com/pgvector/pgvector/blob/master/README.md)

⚠为了安全起见，最好直接从自述文件中复制命令。但是，如果您好奇，以下是我成功的方法：

```cd
git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git
cd pgvector
make
sudo make install

```

**之后** ，我能够运行第 16 步中的迁移，并通过遵循指南的其余部分完成了安装。 🎉

---

_[View the full topic](https://meta.discourse.org/t/guide-to-setting-up-discourse-development-environment-windows-11/282227)._
