puppet-mastodon/templates/install_ruby.sh.erb
2023-11-28 10:54:26 +02:00

9 lines
533 B
Text

#!/bin/bash
set -euo pipefail
if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' ]; then
cd '<%= @mastodon_home %>'
sudo -u <%= @mastodon_user %> RUBY_CONFIGURE_OPTS=--with-jemalloc '<%= @mastodon_home %>/.rbenv/bin/rbenv' install '<%= @ruby_version %>'
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/.rbenv/bin/rbenv' global '<%= @ruby_version %>'
sudo -u <%= @mastodon_user %> '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/gem' install bundler --no-document
fi