تثبيت 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 وإعادة تشغيلها يضمن أن يتم التقاط المسارات للحزم المثبتة بشكل صحيح بواسطة الطرفية.

استنساخ (Clone) مستودع Discourse

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

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

رمز ~ يشير إلى المجلد الرئيسي (Home folder)، لذا سيكون كود مصدر Discourse متاحًا في مجلدك الرئيسي.

تهيئة (Bootstrap) 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 ومجمّع الواجهة الأمامية (frontend bundler) بشكل منفصل عبر

bundle exec rails server

و

bin/dev --only ember

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

bin/dev # يشغّل Pitchfork ومجمّع الواجهة الأمامية معًا

:tada: يجب أن تكون قادرًا الآن على الانتقال إلى http://localhost:3000 لرؤية تثبيت 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?
Help me setup my Discourse development environment
Starting discourse fails with bootstrap error
Please help, how do I install Discourse on macOS?
MacOS Installation Gem::FilePermissionError
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
Local installation internal use only
Discourse standalone
Regarding the installation - docker
Ember-cli error on local MacOS development
Importing / migrating from Zendesk Community to Discourse
I want to build a debug version of discourse
Redis version error when I run bundle exec db:create
Change unicorn port from 3000 in development
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 a vBulletin 3 forum to Discourse via XenForo
Migrate a MyBB forum to Discourse
Category option: max topics per user (2 use-case examples)
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
Vagrant based server failing on db:migrate
Discourse Connect on Local instance is not working
Local development and deploying from same repo
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"
Disabling SSO in development environment
Install on macOS – Failure: Scheduler::Defer can pause and resume
Stuck in infinite loop in Mac terminal after source ~/.bashrc
Can't set up dev environment due to cppjieba_rb failing to install
Override profile background via SSO
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?
[PAID] Import from Legacy Postgres DB
Migrate from GetSatisfaction to Discourse
Case study of an amateur plugin author
Upgrading Mathjax to version 4
Windows server publish method
Rake aborted message is showing when installing vagrant development
Discourse as Your First Rails App
Topic List Previews (TLP)
Nginx Performance Report plugin incompatible with development environment setup script
Installing problem - bundle install
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?
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
/admin/config/emoji non responsive/locks up
App.yml file does not exist when installing Discourse locally