# 开发环境有什么好处？

**URL:** https://meta.discourse.org/t/what-are-the-benefits-of-a-dev-environment/300709
**Category:** Development
**Tags:** dev-install
**Created:** [2024 年3 月 24 日 08:55 UTC](https://meta.discourse.org/t/what-are-the-benefits-of-a-dev-environment/300709 "2024-03-24T08:55:18Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### 作者： ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### 发布日期： [2024 年3 月 24 日 10:19 UTC](https://meta.discourse.org/t/what-are-the-benefits-of-a-dev-environment/300709/2 "2024-03-24T10:19:05Z")

</div>

开发环境对于开发核心本身或插件特别有用：

- 快速部署更改，无需每次都完全重建资源
- 调试
  - 使用 `pry` 或 `byebug` 等工具（甚至 `puts`！）
  - 日志级别

- 无需域名或证书
- 大多数时候不需要互联网访问（在火车上或互联网访问缓慢的地方工作？）
- 使用未压缩的 JavaScript 更愉快、更高效、更具生产力。

注意，有一个 [docker 开发安装](https://meta.discourse.org/t/install-discourse-for-development-using-docker/102009) 可以利用，因此在开发环境工作并不意味着不利用 docker。（我实际上在云中使用 docker compose 创建了我自己的混合开发环境）。

如果您正在开发主题或主题组件，使用 [Install the Discourse Theme CLI console app to help you build themes](https://meta.discourse.org/t/install-the-discourse-theme-cli-console-app-to-help-you-build-themes/82950) 在生产环境中开发主题或主题组件效果会非常好，前提是您使用的是未向普通用户公开的主题。

---

_[View the full topic](https://meta.discourse.org/t/what-are-the-benefits-of-a-dev-environment/300709)._
