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

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

Windows 上で Discourse の開発環境を構築するには、Windows Subsystem for Linux 機能を使用できます。

このセットアップには WSL 2 のインストールが必要です。Windows 10 ビルド 18917 以降でのみ利用可能です。 ここでは、すでに Windows 10 システムに Windows Subsystem for Linux 2 (Ubuntu) がインストールされていると仮定します。警告: 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 ~

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

#!/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 のエンタープライズ、プロ、または教育エディションを使用している場合は、hyper-v で Linux 仮想マシンを作成して Discourse 開発環境をセットアップすることもできます。

Windows 環境に関するノート

2020 年 6 月 30 日時点:
2020 年 7 月 1 日時点

最終更新: @SaraDev による 2022-06-16T02:00:00Z


このドキュメントはバージョン管理されています。変更を提案するには 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?
How can i install Discourse forum on my win 10 dedicated server OVH
Error installing `bullseye-backports` when trying to install for Development
How to install on localhost
Restoring backup fails in Win10/Ubuntu development environment
Trying to set up Discourse on my website
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
No such file or directory - convert (Errno::ENOENT)
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
Restoring backup fails in Win10/Ubuntu development environment
Migrate a Ning forum to Discourse
Windows server publish method
Use the Discourse API ruby gem
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