開発用 Windows に Discourse をインストール

:information_source: このチュートリアルは Windows 10 および 11 でテストされています。

Windows 上で Discourse の開発環境をセットアップするには、Windows Subsystem for Linux 機能を使用することができます。

このセットアップには WSL 2 のインストールが必要です。Windows 10 ビルド 18917 以降でのみ利用可能です。 ここでは、Windows 10 システムにすでに Windows Subsystem for Linux 2 (Ubuntu) がインストールされていることを前提とします。警告: 20.04 では一部のインストールが失敗するため、Ubuntu 18.04 をインストールし、20.04 はインストールしないでください。詳細については、この投稿の下部にある 2020 年 6 月 30 日のメモをご覧ください。

では、始めましょう!

Discourse のインストール

  1. まず、トピック Beginners Guide to Install Discourse on Ubuntu for Development の手順に従いClone Discourse のステップまで進みます。
  1. データベースのセットアップの前に、以下のコマンドを使用して PostgreSQL サービスと Redis サーバーを手動で起動する必要があります。

    sudo service postgresql start
    redis-server --daemonize yes
    
  2. 次に、Ubuntu ガイド の残りのすべての手順を実行します。

Discourse 起動コマンドの作成

これで開発環境はほぼ準備完了です。 唯一の問題は、Windows で Ubuntu を開くたびに PostgreSQL サービスと Redis サーバーを手動で起動する必要があることです。心配しないでください、カスタムコマンドを作成することでこれを回避できます :wink:

cd ~
```\n
コマンド `nano start-discourse` を使用して新しいファイルを作成し、以下の内容を貼り付けて保存し、終了します。

```sh
#!/bin/bash

# PostgreSQL を起動
sudo service postgresql start

# Redis サーバーを起動
redis-server --daemonize yes

次に、以下のコマンドを使用して CHMOD を変更します。

chmod +x start-discourse

そして、ファイルを bin フォルダにコピーします。

sudo cp start-discourse /usr/bin/

これで完了です。 今後、Ubuntu bash を開くたびに、以下のコマンドを実行して開発を開始できます :+1:

start-discourse

あるいは、Windows 10 Enterprise、Pro、または Education Edition を使用している場合は、hyper-v で Linux 仮想マシンを作成して Discourse 開発環境をセットアップすることもできます。

Windows 環境に関する注意

2020 年 6 月 30 日現在:
2020 年 7 月 1 日現在

Last Reviewed by @SaraDev on 2022-06-16T02:00:00Z


このドキュメントはバージョン管理されています - 変更提案は on github でお願いします。

「いいね!」 52
How to install Discourse on windows
Help installing Discourse for Developer
Database connection error when setting up Discourse development environment using Linux Bash Shell on Windows 10
Restoring backup fails in Win10/Ubuntu development environment
How to Install Discourse on LocalHost in Windows?
Error installing `bullseye-backports` when trying to install for Development
How can i install Discourse forum on my win 10 dedicated server OVH
How to install on localhost
Trying to set up Discourse on my website
Restoring backup fails in Win10/Ubuntu development environment
Help with setting up discourse An error occurred while installing xorcist (1.1.2), and Bundler cannot continue
Migrate a MyBB forum to Discourse
Migrate a NodeBB forum with MongoDB to Discourse
Migrate a Phorum forum to Discourse
Migrate a PunBB forum to Discourse
Migrate from another forum to Discourse
Unable to setup discourse in my windows 10
Self hosting discourse with WSL shows an error, the command shown also doesnt work
Restoring backup fails in Win10/Ubuntu development environment
PG::UndefinedTable: ERROR: relation "pg_range" does not exist
I'm having trouble installing a local Discourse instance on Windows 11
Issues while installing Discourse on WSL
Guide to Setting Up Discourse Development Environment - Windows 11
Need help integrating code wrote on Edittext to the Discourse
Problem in development Installation
Contributing to Discourse development
Subscribe to post an ad
Use the Discourse API ruby gem
Migrate a Ning forum to Discourse
Windows server publish method
什么时候支持使用 wsl 容器部署 Discourse 开发环境?
No such file or directory - convert (Errno::ENOENT)
Topics which users cannot directly reply to, but can create a linked topic?
How to add a new language
How to Start Sidekiq When Using Puma
Discourse-webpack: A boilerplate for developing JS-heavy Discourse components
How can I directly edit Discourse database from a GUI?
Can't set up dev environment due to cppjieba_rb failing to install
Cloning and making our own Discourse community
How to Add Ngrok to Allowed Hosts
»vagrant up« hangs
Discourse installation end to end on Windows Server 2016
No connection to db issue
How to Install Discourse on LocalHost in Windows?
WSL environment deadlocks
Problem with development on Windows with Docker and mounted volume
Please help, how do I install Discourse on macOS?
Discourse standalone
Set up a local Discourse Development Environment?
Migrate a NodeBB forum with Redis to Discourse