Installa Discourse su Windows per lo sviluppo

:information_source: Questa guida è stata testata su Windows 10 e 11.

Per configurare un ambiente di sviluppo per Discourse su Windows, puoi utilizzare la funzionalità Windows Subsystem for Linux.

Questa configurazione richiede l’installazione di WSL 2. È disponibile solo nelle build di Windows 10 18917 o successive. Diamo per scontato che tu abbia già installato Windows Subsystem for Linux 2 (Ubuntu) sul tuo sistema Windows 10. ATTENZIONE: Installa Ubuntu 18.04 e non 20.04, poiché alcune installazioni potrebbero fallire su 20.04. Per ulteriori informazioni, consulta le note del 30 giugno 2020 alla fine di questo post.

Iniziamo!

Installazione di Discourse

  1. Inizialmente, segui i passaggi del topic Guida per principianti per installare Discourse su Ubuntu per lo sviluppo fino al passaggio Clona Discourse.
  1. Prima di configurare il database, devi avviare manualmente il servizio PostgreSQL e il server Redis utilizzando i seguenti comandi:

    sudo service postgresql start
    redis-server --daemonize yes
    
  2. Quindi segui tutti i passaggi rimanenti della guida Ubuntu.

Creare un comando per avviare Discourse

Ora il tuo ambiente di sviluppo è quasi pronto. L’unico problema è che ogni volta che apri Ubuntu su Windows devi avviare manualmente il servizio PostgreSQL e il server Redis. Non preoccuparti, possiamo trovare una soluzione creando un comando personalizzato :wink:

cd ~

Crea un nuovo file utilizzando il comando nano start-discourse, incolla il contenuto sottostante, quindi salva ed esci.

#!/bin/bash

# per avviare PostgreSQL
sudo service postgresql start

# per avviare il server Redis
redis-server --daemonize yes

Ora modifica i permessi CHMOD utilizzando il comando seguente:

chmod +x start-discourse

E copia il file nella tua cartella bin:

sudo cp start-discourse /usr/bin/

È fatto. Ora, ogni volta che apri la shell di Ubuntu, esegui semplicemente il comando sottostante e inizia a sviluppare :+1:

start-discourse

In alternativa, se stai utilizzando Windows 10 Enterprise, Pro o Education, puoi creare una macchina virtuale Linux in Hyper-V per configurare l’ambiente di sviluppo di Discourse.

Note sull’ambiente Windows

A partire dal 30 giugno 2020:
A partire dal 1 luglio 2020

Ultima revisione da @SaraDev il 2022-06-16T02:00:00Z


Questo documento è sottoposto a controllo versione - suggerisci modifiche su GitHub.

52 Mi Piace
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