Installer Discourse sur macOS pour le développement

:warning: Ce guide couvre les instructions d’installation pour un environnement de développement macOS. Pour les guides de production, consultez : Install Discourse in production with the official supported instructions

Vous souhaitez configurer Discourse sur macOS pour le développer et y apporter des modifications ?

Nous supposerons que Ruby, Rails, Postgres et Redis ne sont pas installés sur votre Mac. Commençons :rocket

Installer les dépendances de Discourse

Vous aurez besoin des packages suivants sur votre système :

** optionnel

redémarrez votre terminal

Maintenant que les dépendances de Discourse sont installées, passons à l’installation de Discourse lui-même.

Redémarrer votre terminal

Quitter et redémarrer votre shell garantit que les chemins vers les packages installés sont correctement pris en compte par le terminal.

Cloner Discourse

Clonez le dépôt Discourse dans le dossier ~/discourse :

git clone https://github.com/discourse/discourse.git ~/discourse

~ indique le dossier personnel, donc le code source de Discourse sera disponible dans votre dossier personnel.

Initialiser Discourse

Accédez au dossier Discourse :

cd ~/discourse

Installez les gems nécessaires :

bundle install

Installez les dépendances JS :

pnpm install

Ensuite, exécutez ces commandes pour configurer votre instance locale de Discourse :

bundle exec rake db:create
bundle exec rake db:migrate
RAILS_ENV=test bundle exec rake db:create db:migrate

Démarrez les serveurs Rails et Ember. Vous avez deux options ici.

Option 1 : en utilisant deux onglets/fenêtres de terminal séparés, exécutez Rails et le bundler frontend séparément via :

bundle exec rails server

et

bin/dev --only ember

Option 2 : en utilisant un seul onglet/fenêtre de terminal :

bin/dev # exécute Pitchfork et le bundler frontend ensemble

:tada: Vous devriez maintenant pouvoir naviguer vers http://localhost:3000 pour voir votre installation locale de Discourse. (Notez que le premier chargement peut prendre jusqu’à une minute pendant que le serveur se réchauffe.)

Vous pouvez également essayer d’exécuter les spécifications :

bundle exec rake autospec

Toutes (ou presque toutes) les tests devraient passer.

Créer un nouvel administrateur

Pour créer un nouvel administrateur, exécutez la commande suivante :

RAILS_ENV=development bundle exec rake admin:create

Suivez les invites pour créer un compte administrateur.

Configurer la messagerie

Exécutez MailHog :

mailhog

Félicitations ! Vous êtes maintenant l’administrateur de votre propre installation Discourse !

Bon développement ! Pour commencer, consultez le Guide pour débutants sur la création de plugins Discourse.


Ce document est versionné - proposez des modifications sur GitHub.

78 « J'aime »
Setup discourse on Mac OS
Running Discourse on Docker for Mac
Localhost:3000/users gives no-results
How to install Discourse on windows
How to install Discourse locally?
Best dev installation method for running on macOS?
Error after cleaning tmp folder
Please help, how do I install Discourse on macOS?
Discourse standalone
Starting discourse fails with bootstrap error
Local installation internal use only
UndefinedTable: ERROR: relation "web_hook_event_types" when trying to run rspec test
Help me setup my Discourse development environment
Migrate a NodeBB forum with Redis to Discourse
MacOS Installation Gem::FilePermissionError
Migrate a PunBB forum to Discourse
Migrate a phpBB3 forum to Discourse
Migrate a FluxBB forum to Discourse
Migrate a vBulletin 3 forum to Discourse via XenForo
Migrate a MyBB forum to Discourse
Migrate a NodeBB forum with MongoDB to Discourse
Migrate a Ning forum to Discourse
Migrate a Phorum forum to Discourse
Migrate from another forum to Discourse
Migrate a Kunena 3 forum to Discourse
Migrate a bbPress WordPress plugin forum to Discourse
Install Discourse for development using Docker
Use the Discourse API ruby gem
Regarding the installation - docker
Set Environmental Variables
Need help integrating code wrote on Edittext to the Discourse
Keyboard navigation messes up the search menu
WP-Discourse not connected and admin email not recognized
Contributing to Discourse development
How to install discussions on localhost in my mac?
How to install Discourse for Wordpress locally running on MAMP
Error when building: "Runtime Error: discourse does not support compiling scss/sass files via sprockets"
Migrate from GetSatisfaction to Discourse
Case study of an amateur plugin author
Upgrading Mathjax to version 4
Windows server publish method
Discourse as Your First Rails App
Topic List Previews (TLP)
Enable CORS on localhost for DiscourseConnect
Category option: max topics per user (2 use-case examples)
Can't deploy to heroku
[PAID] Import from Legacy Postgres DB
Vagrant based server failing on db:migrate
Change unicorn port from 3000 in development
I want to build a debug version of discourse
Moderation Tools
Rails server --daemon and plugins
Installing problem - bundle install
Nginx Performance Report plugin incompatible with development environment setup script
Rake aborted message is showing when installing vagrant development
Update PhantomJS to latest for Ubuntu dev guide?
Cannot Backup my Development Instance (Fails)
Install error : Protocol violation
Can't set up dev environment due to cppjieba_rb failing to install
How to edit the discourse files? A development box?
How to add a new language
How to relax Content Security Policy
Installing Discourse for macOS Development Using asdf and docker-compose
Override profile background via SSO
Can't set up dev environment due to cppjieba_rb failing to install
Stuck in infinite loop in Mac terminal after source ~/.bashrc
Install on macOS – Failure: Scheduler::Defer can pause and resume
Disabling SSO in development environment
Local development and deploying from same repo
Discourse Connect on Local instance is not working
Can't start localhost server -- file was built for x86_64 which is not the architecture being linked (i386)
Please help, how do I install Discourse on macOS?
How to connect to an external database running on localhost
How can I include discourse in my local dev stack?
Global messages on 94632 timed out, restarting process, 95535 successfully terminated by `TERM` signal
Cannot get embedding to work
/admin/config/emoji non responsive/locks up
App.yml file does not exist when installing Discourse locally
Ember-cli error on local MacOS development
Importing / migrating from Zendesk Community to Discourse
Redis version error when I run bundle exec db:create
Dev environment setup failed on bundle install
Set up a local Discourse Development Environment?
[Need help][MacOS M1 dev installation] ArgumentError unknown keywords