Komplette Einrichtung
-
Fügen Sie diesen Befehl ein:
bash <(wget -qO- https://raw.githubusercontent.com/discourse/install-rails/main/linux)
-
Sie erhalten diesen Fehler:
Installation von ImageMagick …
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libtool ist bereits die neueste Version (2.4.7-7build1).
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
graphicsmagick libgraphicsmagick-q16-3t64 libhwy1t64 libjpeg9 libjxl0.7
Verwenden Sie 'sudo apt autoremove', um sie zu entfernen.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
--2024-08-14 03:41:23-- https://raw.githubusercontent.com/discourse/discourse_docker/main/image/base/install-imagemagick
Auflösen von raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.111.133, ...
Verbinden mit raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 200 OK
Länge: 2624 (2,6K) [text/plain]
Speichern unter: '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' gespeichert [2624/2624]**
**chmod: Ändern der Berechtigungen von 'install-imagemagick': Operation nicht erlaubt**
**fehlgeschlagen**
-
sudo apt-get install imagemagick
-
magick --version
Sie erhalten diesen Fehler
test@tworks:~$ magick --version
Befehl ‘magick’ nicht gefunden, meinten Sie:
Befehl ‘magics’ aus deb magics++ (4.14.2-2)
Befehl ‘magic’ aus deb magic (8.3.105+ds.1-1.1)
Versuchen Sie: sudo apt install
-
cd
-
sudo apt install build-essential make git
-
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
-
cd ImageMagick
-
./configure
-
make
-
sudo make install
-
sudo ldconfig /usr/local/lib
-
convert -version
**Ausgabe**
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
Lizenz: https://imagemagick.org/script/license.php
Funktionen: Cipher DPC Modules OpenMP(4.5)
Delegates (eingebaut): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png raw tiff webp wmf x xml zlib
-
sudo find /home/$USER -name magick 2>/dev/null
Ausgabe
test@tworks:~/ImageMagick$ sudo find /home/$USER -name magick 2>/dev/null
/home/test/ImageMagick/utilities/magick
/home/test/ImageMagick/utilities/.libs/magick
-
Fügen Sie diesen Befehl ein (Ersetzen Sie test durch Ihren Benutzernamen)
echo ‘export PATH=“/home/test/ImageMagick/utilities:$PATH”’ >> ~/.bashrc
source ~/.bashrc
-
magick --version
Ausgabe
Version: ImageMagick 7.1.1-37 (Beta) Q16-HDRI x86_64 852a4e91b:20240727 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
Lizenz: ImageMagick | License
Funktionen: Cipher DPC HDRI OpenMP(4.5)
Delegates (eingebaut): bzlib fontconfig freetype heic jbig jng jpeg lzma png tiff webp x xml zlib zstd
Compiler: gcc (13.2)
- cd
- Fügen Sie dies ein:
bash <(wget -qO- https://files.suhail.app/ok.sh)
Wenn diese URL nicht gefunden wird:
Erstellen Sie dann eine Datei script.sh
Fügen Sie dies ein:
#!/usr/bin/env bash
# Rails installieren
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
# Ubuntu 22+ fordert zum Neustart von Diensten auf, wenn diese nicht gesetzt sind
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 "Installation von Bild-Utilities ..."
sudo -E apt-get -y install advancecomp gifsicle jpegoptim libjpeg-progs optipng pngcrush pngquant
sudo -E apt-get -y install jhead
# oxipng installieren
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 "Installation von 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 "Installation von ruby-build, um Rubies zu installieren ..."
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
fi
ruby_version="3.2.1"
log_info "Installation von Ruby $ruby_version ..."
rbenv install "$ruby_version"
log_info "Setzen von $ruby_version als globales Standard-Ruby ..."
rbenv global $ruby_version
rbenv rehash
log_info "Aktualisierung auf die neueste Rubygems-Version ..."
gem update --system
log_info "Installation von Rails ..."
gem install rails
log_info "Installation von Bundler ..."
gem install bundler
log_info "Installation von 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 "Installation von 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
# Rails installieren
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" >&2; exit $ret' EXIT
# Ubuntu 22+ fordert zum Neustart von Diensten auf, wenn diese nicht gesetzt sind
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 "Aktualisierung der Pakete ..."
sudo -E apt-get update
log_info "Installation von Git ..."
sudo -E apt-get -y install git
log_info "Installation von Build-Essentials ..."
sudo -E apt-get -y install build-essential
log_info "Installation von Bibliotheken für gängige Gem-Abhängigkeiten ..."
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 "Installation von sqlite3 ..."
sudo -E apt-get -y install libsqlite3-dev sqlite3
log_info "Installation von 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 "Installation von curl ..."
sudo -E apt-get -y install curl
log_info "Installation von 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 "Installation von 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 "Installation von Bild-Utilities ..."
sudo -E apt-get -y install advancecomp gifsicle jpegoptim libjpeg-progs optipng pngcrush pngquant
sudo -E apt-get -y install jhead
# oxipng installieren
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 "Installation von 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 "Installation von ruby-build, um Rubies zu installieren ..."
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
fi
ruby_version="3.2.1"
log_info "Installation von Ruby $ruby_version ..."
rbenv install "$ruby_version"
log_info "Setzen von $ruby_version als globales Standard-Ruby ..."
rbenv global $ruby_version
rbenv rehash
log_info "Aktualisierung auf die neueste Rubygems-Version ..."
gem update --system
log_info "Installation von Rails ..."
gem install rails
log_info "Installation von Bundler ..."
gem install bundler
log_info "Installation von 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 "Installation von 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
- Es werden rbenv, ruby-build und Ruby 3.2.1 installiert.
Die Installation von Ruby 3.2.1 dauert ca. 5 Minuten …bitte haben Sie Geduld …
Ausgabe
Installation von MailHog ...
^[[B^[[B
Installation von Node.js 18 ...
2024-08-14 04:11:55 - Installation der Voraussetzungen
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 ist bereits die neueste Version (2.7.14build2).
ca-certificates ist bereits die neueste Version (20240203).
curl ist bereits die neueste Version (8.5.0-2ubuntu10.2).
gnupg ist bereits die neueste Version (2.4.4-2ubuntu17).
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
graphicsmagick libgraphicsmagick-q16-3t64 libhwy1t64 libjpeg9 libjxl0.7
Verwenden Sie 'sudo apt autoremove', um sie zu entfernen.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
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 erfolgreich konfiguriert.
2024-08-14 04:12:02 - Um Node.js zu installieren, führen Sie aus: apt-get install nodejs -y
2024-08-14 04:12:02 - Sie können N|solid Runtime als Node.js-Alternative verwenden
2024-08-14 04:12:02 - Um N|solid Runtime zu installieren, führen Sie aus: apt-get install nsolid -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
nodejs ist bereits die neueste Version (20.16.0-1nodesource1).
Die folgenden Pakete wurden automatisch installiert und werden nicht mehr benötigt:
graphicsmagick libgraphicsmagick-q16-3t64 libhwy1t64 libjpeg9 libjxl0.7
Verwenden Sie 'sudo apt autoremove', um sie zu entfernen.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
19 Pakete geändert in 3s
9 Pakete suchen nach Finanzierung
führen Sie 'npm fund' für Details aus
1 Paket geändert in 672ms
/dev/fd/63: Zeile 80: 1~#!/usr/bin/env: Datei oder Verzeichnis nicht gefunden
fehlgeschlagen
- cd && git clone GitHub - discourse/discourse: A platform for community discussion. Free, open, simple. · GitHub ~/discourse
- cd ~/discourse
- source ~/.bashrc
- bundle install || bundle install
Ausgabe
Nachinstallationsnachricht von rubyzip:
RubyZip 3.0 kommt!
Die öffentliche API einiger Rubyzip-Klassen wurde modernisiert, um benannte
Parameter für optionale Argumente zu verwenden. Bitte überprüfen Sie Ihre Verwendung der
folgenden Klassen:
Zip::File
Zip::Entry
Zip::InputStream
Zip::OutputStream
Bitte stellen Sie sicher, dass Ihre Gemfiles und .gemspecs geeignet restriktiv sind,
um unerwartete Ausfälle bei der Veröffentlichung von 3.0 zu vermeiden (z. B. ~> 2.3.0).
Details unter GitHub - rubyzip/rubyzip: Official Rubyzip repository · GitHub. Das Changelog listet auch
andere Verbesserungen und Fehlerkorrekturen auf, die seit Version 2.3.0 implementiert wurden.
-
yarn install
Ausgabe
test@tworks:~/discourse$ yarn install
yarn install v1.22.22
[1/5] Validieren von package.json…
[2/5] Auflösen von Paketen…
warning Resolution field “unset-value@2.0.1” ist inkompatibel mit der angeforderten 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
Anwenden von Patches…
babel-plugin-debug-macros@0.3.4 
content-tag@2.0.1 
decorator-transforms@2.0.0 
ember-this-fallback@0.4.0 (1 deprecation-name) 
ember-this-fallback@0.4.0 (2 themes) 
ember-this-fallback@0.4.0 (3 exclude-strict-mode) 
virtual-dom@2.1.1 
Done in 1.26s.
-
bin/rails db:create && bin/rails db:migrate && bin/rails db:migrate
-
bin/ember-cli -u
Wenn ein Fehler auftritt,
wie
EACCES: permission denied, mkdir ‘/tmp/suhail/if-you-need-to-delete-this-open-an-issue-async-disk-cache/d828492962979ed87b104d6da2d66d89d2834137’
oder
permission denied $TMPDIR/embroider/webpack-babel-loader/36ae93087b7f9608f2e88c4ce085f854eb311bb409533a5040262f329b132a02.json.gz
Dann geben Sie vollen Zugriff auf diesen Pfad:
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: {
// Hier können Sie experimentelle Funktionen auf einem Ember Canary-Build aktivieren
// z. B. EMBER_NATIVE_DECORATOR_SUPPORT: true
},
EXTEND_PROTOTYPES: {
// Verhindern, dass Ember Data Date.parse überschreibt.
Date: false,
String: false,
},
},
exportApplicationGlobal: true,
APP: {
// Hier können Sie Flags/Optionen an Ihre Anwendungsinstanz übergeben
// wenn sie erstellt wird
},
};
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 {
// Standard (normalerweise 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 bevorzugt dies...
ENV.locationType = "none";
// Halten Sie die Test-Konsolenausgabe leiser
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = "#ember-testing";
ENV.APP.autoboot = false;
}
if (environment === "production") {
// hier können Sie eine produktionsspezifische Funktion aktivieren
}
return ENV;
};
- Wenn lokal: dann gehen Sie zu:
http://localhost:4200
Wenn Cloud: dann gehen Sie zu:
http://cloudPublicIp:4200
Beispiel: http://139.59.13.239:4200/