تثبيت Discourse على macOS للتطوير

:warning: This guide covers installation instructions for a macOS development environment, for production guides see: Install Discourse in production with the official supported instructions

So you want to set up Discourse on macOS to hack on and develop with?

We’ll assume that you don’t have Ruby/Rails/Postgres/Redis installed on your Mac. Let’s begin :rocket: !

Install Discourse Dependencies

You will need the following packages on your system:

** optional

restart your terminal

Now that we have installed Discourse dependencies, let’s move on to install Discourse itself.

Restart your Terminal

Exit your shell and restarting it ensures that the paths to the installed packages are correctly picked up by the Terminal.

Clone Discourse

Clone the Discourse repository in ~/discourse folder:

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

~ indicates home folder, so Discourse source code will be available in your home folder.

Bootstrap Discourse

Switch to your Discourse folder:

cd ~/discourse

Install the needed gems

bundle install

Install the JS dependencies

pnpm install

Next, run these commands to set up your local Discourse instance:

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

Start rails + Ember servers, you have two options here.

Option 1: using two separate Terminal tabs/windows, run Rails and Ember CLI separately via

bundle exec rails server

and

bin/ember-cli

Option 2: using only one Terminal tab/window:

bin/ember-cli -u # will run the Unicorn server in the background

:tada: You should now be able to navigate to http://localhost:4200 to see your local Discourse installation. (Note that the first load can take up to a minute as the server is warmed up.)

You can also try running the specs:

bundle exec rake autospec

All (or almost all) the tests should pass.

Create New Admin

To create a new admin, run the following command:

RAILS_ENV=development bundle exec rake admin:create

Follow the prompts to create an admin account.

Configure Mail

Run MailHog:

mailhog

Congratulations! You are now the admin of your own Discourse installation!

Happy hacking! And to get started with that, see Beginner’s Guide to Creating Discourse Plugins.


This document is version controlled - suggest changes on github.

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