====== chruby ====== * [[https://github.com/postmodern/chruby#install|Install]] * [[https://github.com/postmodern/ruby-install#install|Install ruby-install]] For ''systemd'' services, this should be sufficient: [Service] User=slack Group=slack WorkingDirectory=/home/slack/porridge/daemon # sbin shouldn't be needed if you are running as a normal user # Environment="PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" Environment="PATH=/bin:/usr/bin:/usr/local/bin" # I have had "chruby-exec[157986]: zsh:1: command not found: chruby" when using zsh Environment="SHELL=/bin/bash" ExecStart=chruby-exec 3.0.3 -- /home/slack/porridge/weather/bin/weatherd # This worked for some services but threw gem errors for others # ExecStart=/opt/rubies/ruby-3.0.3/bin/ruby /home/slack/porridge/weather/bin/weatherd See **[[https://github.com/postmodern/chruby/wiki/Cron|instructions for cron]]**, [[https://www.baeldung.com/linux/systemd-services-environment-variables|congifuring systemd environment]] and [[https://stackoverflow.com/questions/35439123/systemd-environment-directive-to-set-path|setting PATH for systemd]].