개발용 Ubuntu 또는 Debian에 Discourse 설치하기

:warning: 이 가이드는 개발 환경에서의 설치 지침을 다룹니다. 프로덕션 환경 설치 가이드는 다음을 참조하세요: Install Discourse in production with the official supported instructions


Discourse를 Ubuntu 또는 Debian에 설정하여 개발하고 해킹(개발 작업)을 하길 원하시나요?

로컬에서 작업하고 있으며, Ubuntu 또는 Debian 시스템에 Ruby/Rails/Postgres/Redis가 설치되어 있지 않은 것으로 가정합니다. 시작해 보겠습니다!

요구 사항

최소 4GB의 RAM과 2개의 CPU 코어를 권장합니다.

현재 호환성:

OS 호환성
Debian 11 :white_check_mark:
Crostini (Linux on ChromeOS) :white_check_mark:
Ubuntu 22.04 또는 그 이상 :white_check_mark:

Discourse 종속성 설치

시스템에 다음 패키지가 필요합니다:

** 선택 사항

이제 Discourse 종속성이 설치되었으므로, Discourse 자체를 설치하는 단계로 넘어가 보겠습니다.

Discourse 클론

Discourse 저장소를 ~/discourse 폴더에 클론합니다:

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

~는 홈 폴더를 나타내므로, Discourse 소스 코드는 홈 폴더에서 사용할 수 있게 됩니다.

데이터베이스 설정

Linux 시스템 사용자 이름과 동일한 이름으로 역할을 생성합니다:

cd /tmp && sudo -u postgres createuser -s "$USER"

[/details]

Discourse 부트스트랩

Discourse 폴더로 이동합니다:

 cd ~/discourse

필요한 gems를 설치합니다

source ~/.bashrc
bundle install

JS 종속성을 설치합니다

pnpm install

gems가 성공적으로 설치되었으므로, 다음 명령어를 실행합니다:

bin/rails db:create
bin/rails db:migrate
RAILS_ENV=test bin/rails db:create db:migrate

rails와 프론트엔드 번들을 시작합니다:

bin/dev

이미지가 표시되지 않으면 다음 명령어를 대신 사용하세요:
(원격 서버에서 작업 중이라면 IP를 지정할 수도 있습니다)

DISCOURSE_HOSTNAME=localhost UNICORN_LISTENER=localhost:3000 bin/dev

이제 http://localhost:3000으로 이동하여 로컬 Discourse 설치를 확인해야 합니다.

새 관리자 생성

새 관리자를 생성하려면 다음 명령어를 실행합니다:

bin/rails admin:create

프롬프트를 따르면 새 관리자 계정이 생성됩니다.

메일 구성

MailHog를 실행합니다:

mailhog

축하합니다! 이제 자신의 Discourse 설치 환경의 관리자가 되었습니다!

즐거운 개발을! 그리고 시작하기 위해 Discourse 플러그인 만들기 입문가 가이드를 참조하세요.


마지막 검토: @blake, 2023-04-03T06:00:00Z


이 문서는 버전 관리됩니다 - github에서 변경 사항을 제안하세요.

66개의 좋아요
Docker setup for development
Share your Discourse dev setup
How to open via internal IP?
Discourse as Your First Rails App
Why is my dev server not showing me uploaded images in Topics?
Can I install discourse on my local machine
Unable to Install Discourse for development
Issue in setup discourse on ubuntu server
Can't set up dev environment due to cppjieba_rb failing to install
How to add a new language
Override profile background via SSO
Bitnami Discourse VM on Virtualbox + SMTP mail-server for testing
Export only database data Postgres (for users, posts and topics)
Jhead and svgo errors while running specs
Rspec failing to load when using the official beginners guide
How do I go about making a very customized theme?
Moderation Tools
Mini_racer installation issues on ubuntu vagrant (OSX)
Can't install the bundle
Not receiving Activation Email
Bundler cannot continue due installation error of mini_racer 0.4.0
How to setup discourse in my local for development?
How might we better structure #howto?
Please help, how do I install Discourse on macOS?
How might we better structure #howto?
Can't reach Discourse server in VM from Host
Images are not being populated in discourse
How to install Discourse locally?
Discourse Local setup
Is this correct? How long to install dev Version?
Overriding user_guardian.rb in a plugin (no fork necessary!)
How Sam's Windows development environment is configured
Site setting is different Every time on Ubuntu development installation
Problems with understanding the development of Discourse
How do I change the address in the database?
Discourse on local pc
Error while importing topics from Flarum (users, groups import OK)
Flarum To Discourse Migration
Problem in development Installation
Calling out for Testers
Problem in development Installation
Developing on the mobile version of Discourse
Can't build Discourse on Ubuntu 20.10
Discourse standalone
Set up a local Discourse Development Environment?
Unable to setup discourse
Migrate a phpBB3 forum to Discourse
Migrate a vBulletin 4 forum to Discourse
Migrate a FluxBB forum to Discourse
Migrate a NodeBB forum with Redis to Discourse
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 a PunBB forum to Discourse
Migrate from another forum to Discourse
Migrate a Kunena 3 forum to Discourse
Migrate a bbPress WordPress plugin forum to Discourse
Unable to setup discourse
Use the Discourse API ruby gem
Use Screen To Bootstrap A Development Install (Ubuntu)
Set up Discourse for development on Fedora Linux
Need to restart Ember in order to test front-end changes
Error installing `bullseye-backports` when trying to install for Development
Migrate a MyBB forum to Discourse
Local installation internal use only
ImageMagick Install Fails during Dev Installation on Ubuntu 22.04.1
Installing Plugins in Discourse Development Install
Discourse dev install script may need upgrade
I'm having trouble installing a local Discourse instance on Windows 11
Login popup not display
Not able to restore discourse docker backup on Ubuntu discourse installation
Migrate a bbPress WordPress plugin forum to Discourse
Installing Discourse on windows using Docker Desktop
End-to-end system testing for themes and theme components
CSRF problem in development with 'Discourse OpenID Connect' plug-in
Need help integrating code wrote on Edittext to the Discourse
Integration into custom auth system where emails are not unique?
Overriding user_guardian.rb in a plugin (no fork necessary!)
Contributing to Discourse development
Development install fails when running bin/rails db:migrate
Developing Discourse on GitHub Codespaces
Install Discourse on Windows for development
Connecting WP Discourse to a local Discourse Instance running a specific version
Chat not working after dev install
Discourse Ember CLI Proxy Error
Bundling more popular plugins with Discourse core
Dev environment: recommended way to bootstrap the first admin account without email?
Migrate from GetSatisfaction to Discourse
Developing Discourse Plugins - Part 6 - Add acceptance tests
Install Discourse for development using Docker
Install Discourse on macOS for development
Migrate a MyBB forum to Discourse
Discourse Server logs show DB queries when I run the server
ImageMagick Install Fails during Dev Installation on Ubuntu 22.04.1
Docker in VMWare - How to access to Discourse
How can I make my own Discourse plugins?
What is the latest recommended workflow for local development? (Ubuntu 16.04)
What is the latest recommended workflow for local development? (Ubuntu 16.04)
How to customize the Discourse app using docker container?
Uploads location on dev instance?
Update PhantomJS to latest for Ubuntu dev guide?
A check for updates has not been performed lately. Ensure sidekiq is running
How to fix bundler executable conflicts in the `techAPJ/install-rails` script?
Ubuntu development install: Permission denied @ apply2files
Install discourse on localhost
Trouble getting a top level page to Ember
Formal german available?
Any interest in Podman?
Rake aborted message is showing when installing vagrant development
Where is the db connection information discourse?
How to install the bootsnap gem?
State of disqus to discourse importer
Connecting to Droplet
Connecting to Droplet
Install and import Mysql on the development environment
Can't uninstall on Ubuntu 18.04
How to install Discourse on windows
Share your Discourse dev setup
Discourse running very slow on local machine
Can't find the Discourse folder inside virtual box via ssh
Importing MyBB database to Discourse
How to install Discourse on windows
How to create new user with verified email in development mode?
Unable to create Vagrant local installation
Installing problem - bundle install
How to get a docker image of discourse using bash on windows 10?
Attachment filename not set on download
[PAID] Import from Legacy Postgres DB
Does Gemfile need to include svg?
Does Gemfile need to include svg?
Database wont migrate Discourse
I want to build a debug version of discourse
How to reset discourse on dev mode? (w/o docker)
Nodebb to Discourse
RSpec search_spec.rb RateLimiter LimitExceeded problems
Discourse as Your First Rails App
Issue with vagrant version following the dev guide
Which is the better option to self-host?
NULL first_visited_at dates in the topic_users table
Multiple instances. Visiting the second instance signs out the logged in account on the running instance
Can't run my Discourse locally
I want to install a plugin for development, what should I do?
Vbulletin 4 import -
Hello from Gitpod! (installing on google cloud + automated dev setup)
How to Install Discourse on LocalHost in Windows?
Migrating a myBB forum to Discourse using Kubuntu in a VM
Migration from Yahoo! Groups
Does the forum for development start up 24 hours*?
How to allow customs hosts in development mode
Help with setting up discourse An error occurred while installing xorcist (1.1.2), and Bundler cannot continue
Any interest in Podman?

캘린더 플러그ンを 삭제해서 해결했어요. :thinking:

3개의 좋아요

설치가 매우 느립니다

약 45분 동안 로컬 DB에 연결하려고 시도했지만 어떻게 해야 하는지 모르겠습니다:

discourse $bin/rails db:create
We could not find your database: postgres. Which can be found in the database configuration file located at config/database.yml

전체 트레이스는 다음과 같습니다:

discourse $bin/rails db:create --trace
** Invoke db:create (first_time)
** Invoke db:force_skip_persist (first_time)
** Execute db:force_skip_persist
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:create
We could not find your database: postgres. Which can be found in the database configuration file located at config/database.yml.

To resolve this issue:

- Did you create the database for this app, or delete it? You may need to create your database.
- Has the database name changed? Check your database.yml config has the correct database name.

To create your database, run:

        bin/rails db:create
Couldn't create 'discourse_development' database. Please check your configuration.
rails aborted!
ActiveRecord::NoDatabaseError: We could not find your database: postgres. Which can be found in the database configuration file located at config/database.yml. (ActiveRecord::NoDatabaseError)

To resolve this issue:

- Did you create the database for this app, or delete it? You may need to create your database.
- Has the database name changed? Check your database.yml config has the correct database name.

To create your database, run:

        bin/rails db:create
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/postgresql_adapter.rb:81:in `rescue in new_client'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_handling.rb:280:in `connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/postgresql_database_tasks.rb:12:in `connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/postgresql_database_tasks.rb:26:in `create'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:122:in `create'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:184:in `block in create_current'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse_dev_assets-0.0.4/lib/discourse_dev_assets.rb:27:in `block in each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:557:in `block (2 levels) in each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:554:in `each'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:554:in `block in each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:553:in `each'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:553:in `each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse_dev_assets-0.0.4/lib/discourse_dev_assets.rb:22:in `each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:184:in `create_current'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/railties/databases.rake:45:in `block (2 levels) in <main>'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/command.rb:51:in `invoke'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/commands.rb:18:in `<main>'
<internal:/home/dylan/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/home/dylan/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:18:in `<main>'

Caused by:
PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: fe_sendauth: no password supplied (PG::ConnectionBad)
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/pg-1.5.4/lib/pg/connection.rb:696:in `async_connect_or_reset'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/pg-1.5.4/lib/pg/connection.rb:824:in `connect_to_hosts'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/pg-1.5.4/lib/pg/connection.rb:759:in `new'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/pg-1.5.4/lib/pg.rb:63:in `connect'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `public_send'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:656:in `new_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:700:in `checkout_new_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:679:in `try_to_checkout_new_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:640:in `acquire_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:341:in `checkout'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:181:in `connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_adapters/abstract/connection_handler.rb:211:in `retrieve_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_handling.rb:313:in `retrieve_connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/connection_handling.rb:280:in `connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/postgresql_database_tasks.rb:12:in `connection'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/postgresql_database_tasks.rb:26:in `create'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:122:in `create'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:184:in `block in create_current'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse_dev_assets-0.0.4/lib/discourse_dev_assets.rb:27:in `block in each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:557:in `block (2 levels) in each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:554:in `each'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:554:in `block in each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:553:in `each'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:553:in `each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/discourse_dev_assets-0.0.4/lib/discourse_dev_assets.rb:22:in `each_current_configuration'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/tasks/database_tasks.rb:184:in `create_current'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/activerecord-7.0.8.1/lib/active_record/railties/databases.rake:45:in `block (2 levels) in <main>'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `block in execute'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `each'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:281:in `execute'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `synchronize'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:199:in `invoke_with_call_chain'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/task.rb:188:in `invoke'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:188:in `invoke_task'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `each'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:138:in `block in top_level'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:147:in `run_with_threads'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:132:in `top_level'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/application.rb:214:in `standard_exception_handling'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_module.rb:59:in `with_application'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/command.rb:51:in `invoke'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.8.1/lib/rails/commands.rb:18:in `<main>'
<internal:/home/dylan/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/home/dylan/.rbenv/versions/3.2.1/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/dylan/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.18.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:18:in `<main>'
Tasks: TOP => db:create

안녕하세요. Ubuntu Server 24에 설치하려고 시도했는데, ImageMagick을 설치할 수 없습니다:

console log
install-imagemagick                                         100%[========================================================================================================================================>]   2.57K  --.-KB/s    in 0s


2024-06-23 14:08:00 (13.4 MB/s) - ‘install-imagemagick’ saved [2631/2631]

Reading package lists...
Building dependency tree...
Reading state information...
Package 'imagemagick' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libwebp6
E: Unable to locate package libltdl7-dev

Ubuntu에서는 libwebp6 대신 libwebp7이 설치되어야 하는 것 같은데, 스크립트에는 Ubuntu 22에 대해서만 libwebp 버전을 확인하는 코드가 존재합니다:

# Ubuntu 22.04/22.10  doesn't have libwebp6
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')

이 코드는 어떤 경우에도 libwebp7을 설치하도록 수정되어야 한다고 생각합니다…

1개의 좋아요

저도 같은 문제를 겪고 있습니다. 어떤 제안이 있을까요?

메인 스크립트를 다운로드합니다:
https://raw.githubusercontent.com/discourse/install-rails/main/linux

그리고 install-imagemagick도 다운로드합니다.

install-imagemagick 스크립트에서 12번째 줄의 문자열을
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')
에서
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp7')
으로 수정했습니다.

또한 메인 스크립트의 105번째 줄, 즉 install-imagemagick 스크립트를 호출하는 부분도 수정하여, 이 줄에서 원래의 파일이 아닌 제가 수정한 install-imagemagick 설치 파일이 호출되도록 했습니다.

1개의 좋아요

이제 새로운 오류가 발생했습니다:

The value 'bullseye-backports' is invalid for APT::Default-Release as such a release is not available in the sources
failed

포기합니다…
첫 번째 게시물의 지침이 현재 시점에는 유효하지 않다는 점을 여기서 언급할 필요가 있을 것 같습니다.
docker로 시도해 보겠습니다.

1개의 좋아요

얼굴을 한 번 수정해서 Ubuntu 20과 Debian 12 지원 추가를 위한 PR을 올린 적이 있습니다. 이제 다시 살펴봐야 할 것 같습니다.

Ubuntu 24의 경우, 정규식을 다음과 같은 것으로 변경해야 합니다:
grep -qiE 'Ubuntu 2[2-9]'

PR에서 제가 그랬듯이 해당 체크를 제거할 수 있습니다.


당신의 경우, 이 업데이트된 버전을 사용할 수 있습니다:

#!/bin/bash
set -e

# version check: https://github.com/ImageMagick/ImageMagick/releases
IMAGE_MAGICK_VERSION="7.1.0-62"
IMAGE_MAGICK_HASH="d282117bc6d0e91ad1ad685d096623b96ed8e229f911c891d83277b350ef884a"

# We use debian, but GitHub CI is stuck on Ubuntu Bionic, so this must be compatible with both
LIBJPEGTURBO=$(cat /etc/issue | grep -qi Debian && echo 'libjpeg62-turbo libjpeg62-turbo-dev' || echo 'libjpeg-turbo8 libjpeg-turbo8-dev')

# Ubuntu 22/23/24 and Debian 12 don't have libwebp6
LIBWEBP=$(cat /etc/issue | grep -qiE 'Ubuntu 22|Debian.*12' && echo 'libwebp7' || echo 'libwebp6')

PREFIX=/usr/local
WDIR=/tmp/imagemagick

# Install build deps
apt -y -q remove imagemagick
apt -y -q install git make gcc pkg-config autoconf curl g++ yasm cmake \
    libde265-0 libde265-dev ${LIBJPEGTURBO} x265 libx265-dev libtool \
    libpng16-16 libpng-dev ${LIBJPEGTURBO} ${LIBWEBP} libwebp-dev libgomp1 \
    libwebpmux3 libwebpdemux2 ghostscript libxml2-dev libxml2-utils librsvg2-dev \
    libltdl7-dev libbz2-dev gsfonts libtiff-dev libfreetype6-dev libjpeg-dev

apt -y install libheif1 libaom-dev libheif-dev

mkdir -p $WDIR
cd $WDIR

# Build and install ImageMagick
wget -q -O $WDIR/ImageMagick.tar.gz "https://github.com/ImageMagick/ImageMagick/archive/$IMAGE_MAGICK_VERSION.tar.gz"
sha256sum $WDIR/ImageMagick.tar.gz
echo "$IMAGE_MAGICK_HASH $WDIR/ImageMagick.tar.gz" | sha256sum -c
IMDIR=$WDIR/$(tar tzf $WDIR/ImageMagick.tar.gz --wildcards "ImageMagick-*/configure" |cut -d/ -f1)
tar zxf $WDIR/ImageMagick.tar.gz -C $WDIR
cd $IMDIR
PKG_CONF_LIBDIR=$PREFIX/lib LDFLAGS=-L$PREFIX/lib CFLAGS=-I$PREFIX/include ./configure \
          --prefix=$PREFIX \
          --enable-static \
          --enable-bounds-checking \
          --enable-hdri \
          --enable-hugepages \
          --with-threads \
          --with-modules \
          --with-quantum-depth=16 \
          --without-magick-plus-plus \
          --with-bzlib \
          --with-zlib \
          --without-autotrace \
          --with-freetype \
          --with-jpeg \
          --without-lcms \
          --with-lzma \
          --with-png \
          --with-tiff \
          --with-heic \
          --with-rsvg \
          --with-webp
make all && make install

cd $HOME
rm -rf $WDIR
ldconfig /usr/local/lib

# Validate ImageMagick install
test $(convert -version | grep -o -e png -e tiff -e jpeg -e freetype -e heic -e webp | wc -l) -eq 6
3개의 좋아요

네, 작동합니다. 감사합니다! 궁금한 점이 있습니다. 디스코스를 LAN에서 디버깅을 위해 사용하도록 설정하는 방법은 무엇인가요? 제 우분투는 Hyper-V Ubuntu 서버이므로, 디스코스에 접근할 때 “localhost” 대신 로컬 IP 주소(제 경우 192.168.2.20)를 사용하여 다른 PC의 브라우저에서 접속하고 있습니다. 그런데 모든 “self hosted” 이미지에는 404 오류로 접근할 수 없습니다(이들의 URL이 //localhost:4200/uploads/default/original/2X/8/81ce02e47fa4b791e9cb4b880c6c4dab9e0b6d9d.png이기 때문이죠). 당연히 LAN에서는 작동하지 않습니다.

1개의 좋아요

2개의 게시물이 새 주제로 분리되었습니다: Docker 없이 프로덕션 설치

요약: #750를 병합해 주세요. 레거시 시스템은 항상 문제를 동반합니다.

부드럽게 표현했지만, 안내문에는 이렇게 명시되어 있습니다:

이것이 단순한 친절한 제안이라고 착각하는 다른 사람이 있다면, 다시 생각해 보시기 바랍니다. 1GiB의 RAM과 4GiB의 스왑으로 실행을 시도하면 성능 저하가 아닌 다음과 같은 결과가 나타납니다:

Error compiling CSS asset

RuntimeError: Discourse does not support compiling scss/sass files via Sprockets

…/discourse/config/application.rb:190:in `call’

이 스레드에 따르면 이는 RAM 할당이 부족할 때 나타나는 증상입니다.

결국 운이 좋으면 다음과 같이 시작되는 JavaScript 스택 트레이스를 볼 수도 있습니다:

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

그러니 지시를 따르세요! 저는 새로 생성된 VPS로 이 과정을 다시 진행하러 갑니다. 오래되고 구식인 것을 설정하려고 애쓰는 대신, 마침 아직 실행 중인 오래된 퇴역한 bullseye를 재활용해 보았습니다.

아마도 두 번째 리뷰어가 bookworm 지원을 추가하는 그 PR을 살펴봐 주시면 좋겠습니다. 그러면 이 문제에 걸리는 마지막 바보가 제가 아닐 테니까요.

1개의 좋아요

두 번째로 Ubuntu 22.04.4 LTS (Jammy Jellyfish)에서 시도해 보았고, 이제 작동하는 개발 환경을 갖추게 되었습니다. 다만, 설명서에 매우 중요한 명령어가 하나 빠져 있어 몇 번의 시도가 필요했습니다.

./linux를 실행하기 전, gem 캐시 디렉토리를 생성하는 것이 중요한 단계입니다:

mkdir --parent /home/discourse/.cache/gem

이 단계를 누락하면 해당 디렉토리가 root:root 권한으로 생성되어, 새로 생성된 사용자 계정으로 실행할 때 설치가 실패합니다.

전체 설정 완료

Gist 링크: Discourse SetUp · GitHub

  1. 다음 명령을 붙여넣으세요
    bash <(wget -qO- https://raw.githubusercontent.com/discourse/install-rails/main/linux)

  2. 다음과 같은 오류가 발생합니다
    Installing ImageMagick …

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libtool is already the newest version (2.4.7-7build1).
The following packages were automatically installed and are no longer required:
  graphicsmagick libgraphicsmagick-q16-3t64 libhwy1t64 libjpeg9 libjxl0.7
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
--2024-08-14 03:41:23--  https://raw.githubusercontent.com/discourse/discourse_docker/main/image/base/install-imagemagick
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2624 (2.6K) [text/plain]
Saving to: ‘install-imagemagick.3’

install-imagemagick.3   100%[===============================>]   2.56K  --.-KB/s    in 0s

**2024-08-14 03:41:23 (32.6 MB/s) - ‘install-imagemagick.3’ saved [2624/2624]**

**chmod: changing permissions of 'install-imagemagick': Operation not permitted**
**failed**
  1. sudo apt-get install imagemagick

  2. magick --version
    다음과 같은 오류가 발생합니다
    test@tworks:~$ magick --version
    Command ‘magick’ not found, did you mean:
    command ‘magics’ from deb magics++ (4.14.2-2)
    command ‘magic’ from deb magic (8.3.105+ds.1-1.1)
    Try: sudo apt install

  3. cd

  4. sudo apt install build-essential make git

  5. git clone GitHub - ImageMagick/ImageMagick: ImageMagick is a free, open-source software suite for creating, editing, converting, and displaying images. It supports 200+ formats and offers powerful command-line tools and APIs for automation, scripting, and integration across platforms. · GitHub

  6. cd ImageMagick

  7. ./configure

  8. make

  9. sudo make install

  10. sudo ldconfig /usr/local/lib

  11. convert -version

**Output**
test@tworks:~/ImageMagick$ convert -version
Version: ImageMagick 6.9.12-98 Q16 x86_64 18038 https://legacy.imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png raw tiff webp wmf x xml zlib
  1. sudo find /home/$USER -name magick 2>/dev/null
    출력 결과
    test@tworks:~/ImageMagick$ sudo find /home/$USER -name magick 2>/dev/null
    /home/test/ImageMagick/utilities/magick
    /home/test/ImageMagick/utilities/.libs/magick

  2. 다음 명령을 붙여넣으세요 (test를 자신의 사용자 이름으로 변경)
    echo ‘export PATH=“/home/test/ImageMagick/utilities:$PATH”’ >> ~/.bashrc
    source ~/.bashrc

  3. magick --version

Output
Version: ImageMagick 7.1.1-37 (Beta) Q16-HDRI x86_64 852a4e91b:20240727 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: Redirecting...
Features: Cipher DPC HDRI OpenMP(4.5)
Delegates (built-in): bzlib fontconfig freetype heic jbig jng jpeg lzma png tiff webp x xml zlib zstd
Compiler: gcc (13.2)

  1. cd
  2. 다음을 붙여넣으세요
    bash <(wget -qO- https://files.suhail.app/ok.sh)

해당 URL을 찾을 수 없다면

script.sh 파일을 생성하세요

다음 내용을 붙여넣으세요

#!/usr/bin/env bash

# Install Rails

trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT

# Ubuntu 22+ will prompt to restart services without these set
export NEEDRESTART_MODE=a
export DEBIAN_FRONTEND=noninteractive

set -e
log_info() {
  printf "\n\e[0;35m $1\e[0m\n\n"
}

if [ ! -f "$HOME/.bashrc" ]; then
  touch $HOME/.bashrc
fi



log_info "Installing image utilities ..."
  sudo -E apt-get -y install advancecomp gifsicle jpegoptim libjpeg-progs optipng pngcrush pngquant
  sudo -E apt-get -y install jhead

  # Install oxipng
  cd /tmp && \
    wget https://github.com/shssoichiro/oxipng/releases/download/v8.0.0/oxipng-8.0.0-x86_64-unknown-linux-musl.tar.gz && \
    tar -xzvf oxipng-8.0.0-x86_64-unknown-linux-musl.tar.gz && \
    sudo cp oxipng-8.0.0-x86_64-unknown-linux-musl/oxipng /usr/local/bin
  cd /tmp && \
    rm oxipng-8.0.0-x86_64-unknown-linux-musl.tar.gz && \
    rm -Rf oxipng-8.0.0-x86_64-unknown-linux-musl

if [[ ! -d "$HOME/.rbenv" ]]; then
  log_info "Installing rbenv ..."
    git clone https://github.com/rbenv/rbenv.git ~/.rbenv

    if ! grep -qs "rbenv init" ~/.bashrc; then
      printf 'export PATH="$HOME/.rbenv/bin:$PATH"\n' >> ~/.bashrc
      printf 'eval "$(rbenv init - --no-rehash)"\n' >> ~/.bashrc
    fi

    export PATH="$HOME/.rbenv/bin:$PATH"
    eval "$(rbenv init -)"
fi

if [[ ! -d "$HOME/.rbenv/plugins/ruby-build" ]]; then
  log_info "Installing ruby-build, to install Rubies ..."
    git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
fi

ruby_version="3.2.1"

log_info "Installing Ruby $ruby_version ..."
  rbenv install "$ruby_version"

log_info "Setting $ruby_version as global default Ruby ..."
  rbenv global $ruby_version
  rbenv rehash

log_info "Updating to latest Rubygems version ..."
  gem update --system

log_info "Installing Rails ..."
  gem install rails

log_info "Installing Bundler ..."
  gem install bundler

log_info "Installing MailHog ..."
  sudo wget -qO /usr/bin/mailhog https://github.com/mailhog/MailHog/releases/download/v1.0.1/MailHog_linux_amd64
  sudo chmod +x /usr/bin/mailhog

log_info "Installing Node.js 18 ..."
  curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
  sudo -E apt-get -y install nodejs
  sudo npm install -g svgo
  sudo npm install -g yarn
1~#!/usr/bin/env bash

# Install Rails

trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT

# Ubuntu 22+ will prompt to restart services without these set
export NEEDRESTART_MODE=a
export DEBIAN_FRONTEND=noninteractive

set -e
log_info() {
  printf "\n\e[0;35m $1\e[0m\n\n"
}

if [ ! -f "$HOME/.bashrc" ]; then
  touch $HOME/.bashrc
fi

log_info "Updating Packages ..."
  sudo -E apt-get update

log_info "Installing Git ..."
  sudo -E apt-get -y install git

log_info "Installing build essentials ..."
  sudo -E apt-get -y install build-essential

log_info "Installing libraries for common gem dependencies ..."
  sudo -E apt-get -y install libxslt1-dev libcurl4-openssl-dev libksba8 libksba-dev libreadline-dev libssl-dev zlib1g-dev libsnappy-dev libyaml-dev

log_info "Installing sqlite3 ..."
  sudo -E apt-get -y install libsqlite3-dev sqlite3

log_info "Installing Postgres ..."
  sudo -E apt-get -y install postgresql postgresql-server-dev-all postgresql-contrib libpq-dev
  sudo -E service postgresql status || sudo -E service postgresql start
  cd /tmp && sudo -u postgres createuser -s "$USER"

log_info "Installing curl ..."
  sudo -E apt-get -y install curl

log_info "Installing Redis ..."
  cd /tmp && \
    wget https://download.redis.io/redis-stable.tar.gz && \
    tar -xzvf redis-stable.tar.gz && \
    cd redis-stable && \
    make && \
    sudo -E make install
  cd /tmp && \
    rm redis-stable.tar.gz && \
    rm -Rf redis-stable

  sudo adduser --system --group --no-create-home redis
  FILE="/etc/systemd/system/redis-server.service"
  if [ ! -f "$FILE" ]; then
    sudo bash -c "cat > $FILE" <<EOF
[Unit]
Description=redis in-memory data store
After=network.target

[Service]
User=redis
Group=redis
ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
ExecStop=/usr/local/bin/redis-cli shutdown
Restart=always

[Install]
WantedBy=multi-user.target
EOF
  fi

  sudo mkdir -p /var/log/redis /var/lib/redis /etc/redis
  sudo chown redis:redis /var/log/redis /var/lib/redis /etc/redis
  sudo chmod 755 /var/log/redis /var/lib/redis /etc/redis

  FILE="/etc/redis/redis.conf"

  if [ ! -f "$FILE" ]; then
    sudo bash -c "cat > $FILE" <<EOF
bind 127.0.0.1
protected-mode no
port 6379
dir /var/lib/redis
dbfilename dump.rdb
save 900 1
save 300 10
save 60 10000
logfile /var/log/redis/redis-server.log
loglevel debug
EOF
    sudo chown redis:redis "$FILE"
    sudo chmod 644 "$FILE"
  fi

  sudo systemctl daemon-reload
  sudo systemctl enable redis-server
  sudo systemctl start redis-server
  sudo systemctl --no-pager status redis-server
  sudo redis-cli ping

log_info "Installing ImageMagick ..."
  sudo -E apt-get -y install libtool

  wget https://raw.githubusercontent.com/discourse/discourse_docker/main/image/base/install-imagemagick
  sed -i '12s/libwebp6/libwebp7/' install-imagemagick
  chmod +x install-imagemagick
  sudo -E ./install-imagemagick

log_info "Installing image utilities ..."
  sudo -E apt-get -y install advancecomp gifsicle jpegoptim libjpeg-progs optipng pngcrush pngquant
  sudo -E apt-get -y install jhead

  # Install oxipng
  cd /tmp && \
    wget https://github.com/shssoichiro/oxipng/releases/download/v8.0.0/oxipng-8.0.0-x86_64-unknown-linux-musl.tar.gz && \
    tar -xzvf oxipng-8.0.0-x86_64-unknown-linux-musl.tar.gz && \
    sudo cp oxipng-8.0.0-x86_64-unknown-linux-musl/oxipng /usr/local/bin
  cd /tmp && \
    rm oxipng-8.0.0-x86_64-unknown-linux-musl.tar.gz && \
    rm -Rf oxipng-8.0.0-x86_64-unknown-linux-musl

if [[ ! -d "$HOME/.rbenv" ]]; then
  log_info "Installing rbenv ..."
    git clone https://github.com/rbenv/rbenv.git ~/.rbenv

    if ! grep -qs "rbenv init" ~/.bashrc; then
      printf 'export PATH="$HOME/.rbenv/bin:$PATH"\n' >> ~/.bashrc
      printf 'eval "$(rbenv init - --no-rehash)"\n' >> ~/.bashrc
    fi

    export PATH="$HOME/.rbenv/bin:$PATH"
    eval "$(rbenv init -)"
fi

if [[ ! -d "$HOME/.rbenv/plugins/ruby-build" ]]; then
  log_info "Installing ruby-build, to install Rubies ..."
    git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
fi

ruby_version="3.2.1"

log_info "Installing Ruby $ruby_version ..."
  rbenv install "$ruby_version"

log_info "Setting $ruby_version as global default Ruby ..."
  rbenv global $ruby_version
  rbenv rehash

log_info "Updating to latest Rubygems version ..."
  gem update --system

log_info "Installing Rails ..."
  gem install rails

log_info "Installing Bundler ..."
  gem install bundler

log_info "Installing MailHog ..."
  sudo wget -qO /usr/bin/mailhog https://github.com/mailhog/MailHog/releases/download/v1.0.1/MailHog_linux_amd64
  sudo chmod +x /usr/bin/mailhog

log_info "Installing Node.js 18 ..."
  curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
  sudo -E apt-get -y install nodejs
  sudo npm install -g svgo
  sudo npm install -g yarn

  1. rbenv, ruby-build, Ruby 3.2.1이 설치됩니다
    Ruby 3.2.1 설치는 약 5분 정도 걸립니다… 여기서 인내심을 갖고 기다려 주세요…

출력 결과

 Installing MailHog ...


^[[B^[[B
 Installing Node.js 18 ...

2024-08-14 04:11:55 - Installing pre-requisites
Hit:1 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Hit:2 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease
Hit:3 https://deb.nodesource.com/node_18.x nodistro InRelease
Ign:4 https://pkg.jenkins.io/debian-stable binary/ InRelease
Hit:5 https://pkg.jenkins.io/debian-stable binary/ Release
Hit:6 http://mirrors.digitalocean.com/ubuntu noble InRelease
Hit:8 http://mirrors.digitalocean.com/ubuntu noble-updates InRelease
Get:9 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Hit:10 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu noble InRelease
Hit:11 http://mirrors.digitalocean.com/ubuntu noble-backports InRelease
Get:12 http://security.ubuntu.com/ubuntu noble-security/main amd64 c-n-f Metadata [3696 B]
Fetched 130 kB in 2s (67.2 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apt-transport-https is already the newest version (2.7.14build2).
ca-certificates is already the newest version (20240203).
curl is already the newest version (8.5.0-2ubuntu10.2).
gnupg is already the newest version (2.4.4-2ubuntu17).
The following packages were automatically installed and are no longer required:
  graphicsmagick libgraphicsmagick-q16-3t64 libhwy1t64 libjpeg9 libjxl0.7
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Hit:1 https://deb.nodesource.com/node_18.x nodistro InRelease
Hit:2 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease
Ign:3 https://pkg.jenkins.io/debian-stable binary/ InRelease
Hit:4 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Hit:5 https://pkg.jenkins.io/debian-stable binary/ Release
Hit:7 http://mirrors.digitalocean.com/ubuntu noble InRelease
Hit:8 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:9 http://mirrors.digitalocean.com/ubuntu noble-updates InRelease
Hit:10 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu noble InRelease
Hit:11 http://mirrors.digitalocean.com/ubuntu noble-backports InRelease
Reading package lists... Done
2024-08-14 04:12:02 - Repository configured successfully.
2024-08-14 04:12:02 - To install Node.js, run: apt-get install nodejs -y
2024-08-14 04:12:02 - You can use N|solid Runtime as a node.js alternative
2024-08-14 04:12:02 - To install N|solid Runtime, run: apt-get install nsolid -y

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
nodejs is already the newest version (20.16.0-1nodesource1).
The following packages were automatically installed and are no longer required:
  graphicsmagick libgraphicsmagick-q16-3t64 libhwy1t64 libjpeg9 libjxl0.7
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

changed 19 packages in 3s

9 packages are looking for funding
  run `npm fund` for details

changed 1 package in 672ms
/dev/fd/63: line 80: 1~#!/usr/bin/env: No such file or directory
failed

  1. cd && git clone GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. · GitHub ~/discourse
  2. cd ~/discourse
  3. source ~/.bashrc
  4. bundle install || bundle install
    출력 결과
    Post-install message from rubyzip:
    RubyZip 3.0 is coming!

The public API of some Rubyzip classes has been modernized to use named
parameters for optional arguments. Please check your usage of the
following classes:

  • Zip::File
  • Zip::Entry
  • Zip::InputStream
  • Zip::OutputStream

Please ensure that your Gemfiles and .gemspecs are suitably restrictive
to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0).
See GitHub - rubyzip/rubyzip: Official Rubyzip repository · GitHub for details. The Changelog also
lists other enhancements and bugfixes that have been implemented since
version 2.3.0.

  1. yarn install
    출력 결과
    test@tworks:~/discourse$ yarn install
    yarn install v1.22.22
    [1/5] Validating package.json…
    [2/5] Resolving packages…
    warning Resolution field “unset-value@2.0.1” is incompatible with requested version “unset-value@^1.0.0”
    success Already up-to-date.
    $ ./app/assets/javascripts/run-patch-package && rm -rf app/assets/javascripts/node_modules
    patch-package 8.0.0
    Applying patches…
    babel-plugin-debug-macros@0.3.4 :check_mark:
    content-tag@2.0.1 :check_mark:
    decorator-transforms@2.0.0 :check_mark:
    ember-this-fallback@0.4.0 (1 deprecation-name) :check_mark:
    ember-this-fallback@0.4.0 (2 themes) :check_mark:
    ember-this-fallback@0.4.0 (3 exclude-strict-mode) :check_mark:
    virtual-dom@2.1.1 :check_mark:
    Done in 1.26s.

  2. bin/rails db:create && bin/rails db:migrate && bin/rails db:migrate

  3. bin/ember-cli -u

오류가 발생하면

예를 들어
EACCES: permission denied, mkdir ‘/tmp/suhail/if-you-need-to-delete-this-open-an-issue-async-disk-cache/d828492962979ed87b104d6da2d66d89d2834137’
또는
permission denied $TMPDIR/embroider/webpack-babel-loader/36ae93087b7f9608f2e88c4ce085f854eb311bb409533a5040262f329b132a02.json.gz

그 경로에 전체 액세스 권한을 부여하세요

sudo chmod -R 777 /tmp/suhail/if-you-need-to-delete-this-open-an-issue-async-disk-cache/

sudo chmod -R 777 /tmp/embroider/webpack-babel-loader

Discourse Ember CLI Proxy Error
FetchError: request to http://127.0.0.1:3000/ failed, reason: connect ECONNREFUSED 127.0.0.1:3000
at ClientRequest. (file:///home/test/discourse/app/assets/javascripts/custom-proxy/node_modules/node-fetch/src/index.js:108:11)
at ClientRequest.emit (node:events:519:28)
at Socket.socketErrorListener (node:_http_client:500:9)
at Socket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

"use strict";

module.exports = function (environment) {
  const ENV = {
    modulePrefix: "discourse",
    environment,
    rootURL: process.env.DISCOURSE_RELATIVE_URL_ROOT || "/",
    locationType: "history",
    historySupportMiddleware: false,
    EmberENV: {
      FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. EMBER_NATIVE_DECORATOR_SUPPORT: true
      },
      EXTEND_PROTOTYPES: {
        // Prevent Ember Data from overriding Date.parse.
        Date: false,
        String: false,
      },
    },
    exportApplicationGlobal: true,

    APP: {
      // Here you can pass flags/options to your application instance
      // when it is created
    },
  };

  if (process.env.EMBER_RAISE_ON_DEPRECATION === "1") {
    ENV.EmberENV.RAISE_ON_DEPRECATION = true;
  } else if (process.env.EMBER_RAISE_ON_DEPRECATION === "0") {
    ENV.EmberENV.RAISE_ON_DEPRECATION = false;
  } else {
    // Default (normally false; true in core qunit runs)
  }

  if (environment === "development") {
    // ENV.APP.LOG_RESOLVER = true;
    // ENV.APP.LOG_ACTIVE_GENERATION = true;
    // ENV.APP.LOG_TRANSITIONS = true;
    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
    // ENV.APP.LOG_VIEW_LOOKUPS = true;
  }

  if (environment === "test") {
    // Testem prefers this...
    ENV.locationType = "none";

    // keep test console output quieter
    ENV.APP.LOG_ACTIVE_GENERATION = false;
    ENV.APP.LOG_VIEW_LOOKUPS = false;

    ENV.APP.rootElement = "#ember-testing";
    ENV.APP.autoboot = false;
  }

  if (environment === "production") {
    // here you can enable a production-specific feature
  }

  return ENV;
};


  1. 로컬인 경우:

http://localhost:4200

클라우드인 경우:

http://cloudPublicIp:4200
예: http://139.59.13.239:4200/

1개의 좋아요

안녕하세요. 도움을 요청하는 건가요, 아니면 가이드를 올리는 건가요?

1개의 좋아요

네, 제발 도와주세요. 거의 설정을 마쳤는데… 어떻게 편집해야 하는지, 이메일 설정이 헷갈려요.

아치(Arch)에서 이걸 시도해 본 사람 있나요? AUR로 설치할 수 없네요..

더 진행하려다 보니 Rails한테 뺨을 맞은 것 같네요. 그냥 시간만 낭비한 것 같습니다..

네, 해봤습니다. install-rails/linux at main · discourse/install-rails · GitHub 의 스크립트를 참고하여 패키지를 수동으로 설치해야 합니다. 모든 패키지는 pacman 또는 aur를 통해 사용할 수 있습니다. 일부 패키지를 파악하는 데 시행착오가 좀 필요했습니다. 설치할 패키지를 찾는 데 막히셨다면, 해당 과정을 어딘가에 정리해 두었으니 말씀해 주세요.

수정: 어려운 부분은 여기였습니다:

아치에서 이에 해당하는 명령은 다음과 같습니다:

sudo pacman -S base-devel

sudo pacman -S libxslt curl libksba readline openssl zlib snappy libyaml

막히는 부분이 있다면 다른 문제들도 몇 가지 있었습니다. ChatGPT에 접근 권한이 있다면, 이 과정을 거의 안내해 주었습니다.

3개의 좋아요

아직도 postgres를 실행하지 못하겠습니다. 데이터베이스를 초기화할 수 없고, 로그인하려고 하면 존재하지 않는 데이터베이스 때문에… 그냥 거절당하네요.