User Tools

Site Tools


chruby

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
chruby [2023/01/24 12:23] – created slackchruby [2023/02/11 10:28] (current) slack
Line 2: Line 2:
  
   * [[https://github.com/postmodern/chruby#install|Install]]   * [[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]].
chruby.1674562989.txt.gz · Last modified: 2023/01/24 12:23 by slack