Installer Discourse sur Ubuntu ou Debian pour le développement

:warning: This guide covers installation instructions in a development environment. For a production guide see: Install Discourse in production with the official supported instructions


So you want to set up Discourse on Ubuntu or Debian to hack on and develop with?

We’ll assume that you work locally and don’t have Ruby/Rails/Postgres/Redis installed on your Ubuntu or Debian system. Let’s begin!

Requirements

We suggest having at least 4 GB RAM and 2 CPU cores.

Current compatibility:

OS Compatibility
Debian 11 :white_check_mark:
Crostini (Linux on ChromeOS) :white_check_mark:
Ubuntu 22.04 or later :white_check_mark:

Install Discourse Dependencies

You will need the following packages on your system:

** optional

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

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.

Setup Database

Create role with the same name as your Linux system username:

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

[/details]

Bootstrap Discourse

Switch to your Discourse folder:

 cd ~/discourse

Install the needed gems

source ~/.bashrc
bundle install

Install the JS dependencies

pnpm install

Now that you have successfully installed gems, run these commands:

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

Start rails and ember server:

bin/ember-cli -u

If the images are not appearing, use this command instead:
(you can also specify an IP if you are working on a remote server)

DISCOURSE_HOSTNAME=localhost UNICORN_LISTENER=localhost:3000 bin/ember-cli -u

You should now be able to navigate to http://localhost:4200 to see your local Discourse installation.

Create New Admin

To create a new admin, run the following command:

bin/rails admin:create

Follow the prompts, and a new admin account will be created.

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.


Last Reviewed by @blake on 2023-04-03T06:00:00Z


This document is version controlled - suggest changes on github.

65 « J'aime »

corrigé en supprimant le plugin calendrier. :thinking:

3 « J'aime »

l’installation est très lente

I’ve been trying for about 45min to get it to connect to my local DB but can’t figure it out:

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

Here is the full trace:

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

Bonjour. J’essaie d’installer sur un serveur Ubuntu 24 et je ne parviens pas à installer imagemagick :

journal de la console
install-imagemagick                                         100%[=========================================================================================================================================>]   2.57K  --.-KB/s    dans 0s


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

Lecture des listes de paquets...
Construction de l'arbre des dépendances...
Lecture des informations d'état...
Le paquet 'imagemagick' n'est pas installé, donc il n'est pas supprimé
0 mis à niveau, 0 nouvellement installés, 0 à supprimer et 0 non mis à niveau.
Lecture des listes de paquets...
Construction de l'arbre des dépendances...
Lecture des informations d'état...
E : Impossible de trouver le paquet libwebp6
E : Impossible de trouver le paquet libltdl7-dev

Il semble que sur Ubuntu, il faille installer libwebp7 et non libwebp6, mais le script ne vérifie la version de libwebp que pour Ubuntu 22 :

# Ubuntu 22.04/22.10  n'a pas libwebp6
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')

Je pense que ce code doit être modifié pour installer libwebp7 de toute façon…

1 « J'aime »

J’ai le même problème. Des suggestions ?

Je télécharge le script principal :
https://raw.githubusercontent.com/discourse/install-rails/main/linux

et je télécharge install-imagemagick

Dans le script install-imagemagick, j’ai modifié la ligne 12
de :
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp6')
à
LIBWEBP=$(cat /etc/issue | grep -qi 'Ubuntu 22' && echo 'libwebp7' || echo 'libwebp7')

J’ai également modifié la ligne 105 du script principal, où il appelle le script install-imagemagick, donc, sur cette ligne, mon fichier d’installation install-imagemagick modifié serait appelé, et non l’original.

1 « J'aime »

J’ai maintenant une nouvelle erreur :

La valeur 'bullseye-backports' est invalide pour APT::Default-Release car une telle version n'est pas disponible dans les sources
échec

J’abandonne…
Je pense qu’il faut noter ici que les instructions du premier message ne sont plus d’actualité.
J’essaierai avec docker

J’ai fait une demande de tirage il y a quelque temps pour ajouter la prise en charge d’Ubuntu 20 et Debian 12. Je suppose que je devrai la réviser.

Pour Ubuntu 24, vous devrez modifier les expressions régulières pour quelque chose comme :
grep -qiE 'Ubuntu 2[2-9]'

Vous pouvez supprimer la vérification comme je l’ai fait dans la demande de tirage.


Vous pouvez utiliser cette version mise à jour, dans votre cas :

#!/bin/bash
set -e

# vérification de la version : https://github.com/ImageMagick/ImageMagick/releases
IMAGE_MAGICK_VERSION="7.1.0-62"
IMAGE_MAGICK_HASH="d282117bc6d0e91ad1ad685d096623b96ed8e229f911c891d83277b350ef884a"

# Nous utilisons debian, mais GitHub CI est bloqué sur Ubuntu Bionic, donc cela doit être compatible avec les deux
LIBJPEGTURBO=$(cat /etc/issue | grep -qi Debian && echo 'libjpeg62-turbo libjpeg62-turbo-dev' || echo 'libjpeg-turbo8 libjpeg-turbo8-dev')

# Ubuntu 22/23/24 et Debian 12 n'ont pas libwebp6
LIBWEBP=$(cat /etc/issue | grep -qiE 'Ubuntu 22|Debian.*12' && echo 'libwebp7' || echo 'libwebp6')

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

# Installer les dépendances de construction
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

# Construire et installer 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

# Valider l'installation d'ImageMagick
test $(convert -version | grep -o -e png -e tiff -e jpeg -e freetype -e heic -e webp | wc -l) -eq 6
3 « J'aime »

Oui. Ça fonctionne, merci ! J’ai quelques questions. Comment puis-je configurer Discourse pour l’utiliser depuis le LAN pour le débogage ? Mon Ubuntu est un serveur Ubuntu sous Hyper-V, donc j’utilise non pas « localhost » pour accéder à Discourse, mais l’adresse IP locale (192.168.2.20 dans mon cas), depuis le navigateur d’un autre PC, et toutes les images « auto-hébergées » ne sont pas accessibles avec une erreur - 404 (car elles ont une URL - //localhost:4200/uploads/default/original/2X/8/81ce02e47fa4b791e9cb4b880c6c4dab9e0b6d9d.png), et bien sûr, cela ne fonctionne pas depuis le LAN)

1 « J'aime »

2 messages ont été divisées dans un nouveau sujet : Installation en production sans Docker

TL;DR : Veuillez fusionner la [#750][PR-750]. Les systèmes hérités entraînent toujours des problèmes.

Formulé de manière informelle, les instructions indiquent :

Au cas où quelqu’un d’autre ferait l’erreur de croire que ce n’est qu’une suggestion amicale, réfléchissez-y à deux fois. Toute tentative de lancement avec 1 Go de RAM et 4 Go de swap entraînera, non pas une dégradation des performances, mais :

Erreur lors de la compilation de l’actif CSS

RuntimeError : Discourse ne prend pas en charge la compilation des fichiers scss/sass via Sprockets

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

Ce qui, selon [ce fil de discussion][305402], est un symptôme d’une allocation de RAM insuffisante.

Finalement, on pourrait aussi avoir la chance d’obtenir une trace de pile JavaScript commençant par :

ERREUR FATALE : Marque-compactage inefficace près de la limite du tas Échec d’allocation - Tas JavaScript hors mémoire

Alors suivez les instructions ! Je vais refaire cet exercice avec un VPS nouvellement créé. Plutôt que d’essayer de bricoler la mise en place de quelque chose d’aussi ancien et obsolète, j’ai plutôt essayé de réutiliser un ancien système bullseye désaffecté que j’avais encore en fonctionnement.

Peut-être qu’un deuxième relecteur souhaiterait examiner cette PR ajoutant la prise en charge de bookworm, afin que je sois le dernier imbécile à être touché par cela ?

[PR-750] : DEV: Improve support for Ubuntu 20 and Debian 12 by Arkshine · Pull Request #750 · discourse/discourse_docker · GitHub
[305402] : Error when building: discourse does not support compiling scss/sass files via sprockets

1 « J'aime »

J’ai fait une deuxième tentative, sur Ubuntu 22.04.4 LTS (Jammy Jellyfish), et j’ai maintenant un environnement de développement qui semble fonctionner. Cela a cependant nécessité quelques tentatives, car les instructions manquent une commande très importante.

Une étape cruciale avant d’exécuter ./linux est de créer le répertoire de cache des gems :

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

Omettre cette étape entraînera la création du répertoire avec les permissions root:root, ce qui fera échouer l’installation lors de son exécution avec un compte utilisateur nouvellement créé.

Comeplete Setup

Gist Link : Discourse SetUp · GitHub

1.Paste this Command
bash <(wget -qO- https://raw.githubusercontent.com/discourse/install-rails/main/linux)

2.You will get this Error
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
    You will get This Error
    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 7

  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: ImageMagick – License
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 Output test@tworks:~/ImageMagick sudo find /home/$USER -name magick 2>/dev/null
    /home/test/ImageMagick/utilities/magick
    /home/test/ImageMagick/utilities/.libs/magick

  2. Paste this command (Change test to your user)
    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: ImageMagick – License
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. Paste this
    bash <(wget -qO- https://files.suhail.app/ok.sh)

if not found this url

then create a file script.sh

paste this

#!/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 GitHub - rbenv/rbenv: Manage your app's Ruby environment ~/.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 GitHub - rbenv/ruby-build: A tool to download, compile, and install Ruby on Unix-like systems. ~/.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 GitHub - rbenv/rbenv: Manage your app's Ruby environment ~/.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 GitHub - rbenv/ruby-build: A tool to download, compile, and install Ruby on Unix-like systems. ~/.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. It will install rbenv, ruby-build, Ruby 3.2.1
    Ruby 3.2.1 will take 5 mins to install …please be patient here…

Output

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 Debian Jenkins Packages binary/ InRelease
Hit:5 Debian Jenkins Packages binary/ Release
Hit:6 Index of /ubuntu/ noble InRelease
Hit:8 Index of /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 Index of /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 Debian Jenkins Packages binary/ InRelease
Hit:4 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Hit:5 Debian Jenkins Packages binary/ Release
Hit:7 Index of /ubuntu/ noble InRelease
Hit:8 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:9 Index of /ubuntu/ noble-updates InRelease
Hit:10 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu noble InRelease
Hit:11 Index of /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. ~/discourse
  2. cd ~/discourse
  3. source ~/.bashrc
  4. bundle install || bundle install
    Output
    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 for details. The Changelog also
lists other enhancements and bugfixes that have been implemented since
version 2.3.0.

  1. yarn install
    Output
    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 :heavy_check_mark:
    content-tag@2.0.1 :heavy_check_mark:
    decorator-transforms@2.0.0 :heavy_check_mark:
    ember-this-fallback@0.4.0 (1 deprecation-name) :heavy_check_mark:
    ember-this-fallback@0.4.0 (2 themes) :heavy_check_mark:
    ember-this-fallback@0.4.0 (3 exclude-strict-mode) :heavy_check_mark:
    virtual-dom@2.1.1 :heavy_check_mark:
    Done in 1.26s.

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

  3. bin/ember-cli -u

If any error

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

Then give full accesss to that path

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. if local : then go for

http://localhost:4200

if cloud then go for

http://cloudPublicIp:4200
example : http://139.59.13.239:4200/

1 « J'aime »

Salut. Cherchez-vous de l’aide ou publiez-vous un guide ?

1 « J'aime »

Oui, aidez-moi s’il vous plaît, j’ai presque terminé la configuration, mais… comment modifier et configurer l’e-mail me rend confus.

Quelqu’un a-t-il essayé ceci sur Arch ? Je n’arrive pas à l’installer en utilisant l’AUR…

J’ai avancé pour me prendre une claque de la part de Rails, on dirait que j’ai perdu mon temps…

Oui. Vous devez passer par le script à l’adresse install-rails/linux at main · discourse/install-rails · GitHub et installer les paquets manuellement. Ils sont tous disponibles soit avec pacman, soit avec l’aur. Il m’a fallu un peu d’essais et d’erreurs pour trouver certains paquets. J’ai consigné le processus quelque part si vous avez du mal à trouver les paquets à installer.

Edit : la partie délicate était ici :

L’équivalent sur Arch est :

sudo pacman -S base-devel

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

Il y a eu quelques autres problèmes également si vous êtes bloqué. Si vous avez accès à ChatGPT, il m’a plus ou moins guidé tout au long du processus.

3 « J'aime »

Je n’arrive toujours pas à faire fonctionner postgres. Je ne peux pas initialiser la base de données et quand j’essaie de me connecter, il me dit de dégager à cause de… la base de données qui n’existe pas.