ruby

Dies ist eine alte Version des Dokuments!


RUBY & ZAMMAD

Achtung: die Ubuntu Pakete sind veraltet, besser ist die Installation lokal pro User über rbenv. Die Anleitung für Zammad ist auch veraltet und stellenweise falsch, man muss also mischen.

https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-18-04

https://gorails.com/setup/ubuntu/18.04#ruby-rbenv

cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"'>> ~/.bashrc
echo 'eval "$(rbenv init -)"'>> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"'>> ~/.bashrc
exec $SHELL

ssss

ZAMMAD und die Ruby Umgebung werden lokal für den Zammad User installiert. Zammad fordert ruby 2.5.5, das ist aber veraltet, es gibt nur 2.5.8. Also muss man etwas anpassen. Grundsätzliche Zammad Source Installation:

https://docs.zammad.org/en/latest/install/source.html

Die Version wird in .ruby-version und Gemfile auf 2.5.8 angepasst

sudo wget https://ftp.zammad.com/zammad-latest.tar.gz
$ sudo tar -xzf zammad-latest.tar.gz -C zammad

Falsche Permissions korrigieren

chown -R zammad:zammad zammad
$ sudo su - zammad

command prefixed

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
 
echo 'export PATH="$HOME/.rbenv/bin:$PATH"'>> ~/.bashrc
echo 'eval "$(rbenv init -)"'>> ~/.bashrc
source ~/.bashrc

command prefixed

''git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build''
</code-pre>
 
==== Liste installierbarer Versionen ====
 
<code>
rbenv install -l
 
rbenv install 2.6.5

global setzen

rbenv global 2.6.5

verifizieren mit ruby -v. Dabei Versionskonflikt auflösen durch editieren von .ruby-version

zammad@develd:~$ ruby -v
rbenv: version `2.5.5' is not installed (set by /opt/zammad/.ruby-version)
zammad@develd:~$ ruby -v

nano .ruby-version

ggf. richtige Version installieren.

echo "gem: --no-document"> ~/.gemrc

gem install bundler

check

zammad@develd:~$ gem env home
/opt/zammad/.rbenv/versions/2.5.8/lib/ruby/gems/2.5.0

Wechsel auf ZAMMAD Installation

gem install rake rails

Für mysql:


bundle install --without test development postgres

database.yml

#### mysql config #####

 adapter: mysql2
 username: zammad
 password: 4JrdEyqYzkLw7kqT

 # If the database server is not on localhost, you can set hostname and port:
 host: 10.10.10.16
 port: 3306

Datenbank erstellen

bundle exec rake db:create

Datenbank befüllen

bundle exec rake db:migrate

Wiederholte Installation wenn Ruby schon für den User installiert ist:

echo 'export PATH="$HOME/.rbenv/bin:$PATH"'>> ~/.bashrc
zammad@develd:~$ echo 'eval "$(rbenv init -)"'>> ~/.bashrc
zammad@develd:~$ source ~/.bashrc
zammad@develd:~$ type rbenv
zammad@develd:~$ bundle config set without 'test development postgres'

(ersetzt

bundle install --without
test development postgres

Datenbank neu anlegen

bundle exec rake db:create
zammad@host $ bundle exec rake db:migrate
zammad@host $ bundle exec rake db:seed

Danach precompile

bundle exec rake assets:precompile
zammad@develd:~$ cd script/systemd/
zammad@develd:~/script/systemd$ ls
install-zammad-systemd-services.sh  zammad.env  zammad-rails.service  zammad-scheduler.service  zammad.service  zammad-websocket.service
zammad@develd:~/script/systemd$ sudo ./install-zammad-systemd-services.sh
[sudo] password for zammad:
zammad@develd:~/script/systemd$
  • ruby.1602946460.txt.gz
  • Zuletzt geändert: 05/03/2024 - 10:52
  • (Externe Bearbeitung)