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

:warning: يغطي هذا الدليل تعليمات التثبيت لبيئة تطوير macOS، للحصول على أدلة الإنتاج انظر: Install Discourse in production with the official supported instructions

إذًا، هل تريد إعداد Discourse على macOS للعمل عليه والتطوير باستخدامه؟

سنفترض أنك لم تقم بتثبيت Ruby/Rails/Postgres/Redis على جهاز Mac الخاص بك. لنبدأ :rocket:!

تثبيت تبعيات Discourse

ستحتاج إلى الحزم التالية على نظامك:

_** اختياري

أعد تشغيل الطرفية (Terminal)

الآن بعد أن قمنا بتثبيت تبعيات Discourse، دعنا ننتقل إلى تثبيت Discourse نفسه.

أعد تشغيل الطرفية (Terminal)

أغلق جلسة الصدفة (shell) وأعد تشغيلها لضمان التقاط المسارات للحزم المثبتة بشكل صحيح بواسطة الطرفية.

استنساخ Discourse

استنسخ مستودع Discourse في المجلد ~/discourse:

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

يشير ~ إلى المجلد الرئيسي، لذا ستكون الشيفرة المصدرية لـ Discourse متاحة في مجلدك الرئيسي.

تهيئة Discourse

انتقل إلى مجلد Discourse الخاص بك:

cd ~/discourse

ثبّت الـ gems المطلوبة

bundle install

ثبّت تبعيات JS

pnpm install

بعد ذلك، قم بتشغيل هذه الأوامر لإعداد نسخة Discourse المحلية الخاصة بك:

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

شغّل خوادم rails + Ember، لديك خياران هنا.

الخيار 1: باستخدام علامتي تبويب/نافذتين منفصلتين للطرفية، قم بتشغيل Rails و Ember CLI بشكل منفصل عبر

bundle exec rails server

و

bin/ember-cli

الخيار 2: باستخدام علامة تبويب/نافذة طرفية واحدة فقط:

bin/ember-cli -u # سيقوم بتشغيل خادم Unicorn في الخلفية

:tada: يجب أن تكون الآن قادرًا على الانتقال إلى http://localhost:4200 لرؤية تثبيت Discourse المحلي الخاص بك. (لاحظ أن التحميل الأول قد يستغرق ما يصل إلى دقيقة حيث يتم تسخين الخادم.)

يمكنك أيضًا محاولة تشغيل المواصفات (specs):

bundle exec rake autospec

يجب أن تجتاز جميع الاختبارات (أو تقريبًا جميعها).

إنشاء مسؤول جديد

لإنشاء مسؤول جديد، قم بتشغيل الأمر التالي:

RAILS_ENV=development bundle exec rake admin:create

اتبع المطالبات لإنشاء حساب مسؤول.

تكوين البريد

قم بتشغيل MailHog:

mailhog

تهانينا! أنت الآن مسؤول عن تثبيت Discourse الخاص بك!

استمتاع بالتطوير! وللبدء في ذلك، راجع دليل المبتدئين لإنشاء إضافات Discourse.


هذا المستند يتم التحكم في إصداره - اقترح التغييرات على github.

78 إعجابًا
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
Migrate a NodeBB forum with Redis to Discourse
MacOS Installation Gem::FilePermissionError
UndefinedTable: ERROR: relation "web_hook_event_types" when trying to run rspec test
Please help, how do I install Discourse on macOS?
Help me setup my Discourse development environment
Discourse standalone
Local installation internal use only
Starting discourse fails with bootstrap error
[Need help][MacOS M1 dev installation] ArgumentError unknown keywords
Migrate a PunBB forum to Discourse
Migrate a phpBB3 forum to Discourse
Migrate a FluxBB forum to Discourse
Migrate from GetSatisfaction to Discourse
Regarding the installation - docker
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
Enable CORS on localhost for DiscourseConnect
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"
Discourse as Your First Rails App
Upgrading Mathjax to version 4
Windows server publish method
Migrate a vBulletin 3 forum to Discourse via XenForo
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?
Topic List Previews (TLP)
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?