From 33f8e560c1de57193fdb030fdc911d1612933035 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Tue, 28 Nov 2023 15:01:32 +0200 Subject: [PATCH] check for existing ruby --- templates/install_mastodon.sh.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/install_mastodon.sh.erb b/templates/install_mastodon.sh.erb index 8fdf7de..5fee97d 100644 --- a/templates/install_mastodon.sh.erb +++ b/templates/install_mastodon.sh.erb @@ -6,7 +6,9 @@ if [ ! -e '<%= @mastodon_home %>/.mastodon_install' ]; then echo "Installing ruby..." export PATH="<%= @mastodon_home %>/.rbenv/bin:$PATH" eval "$(<%= @mastodon_home %>/.rbenv/bin/rbenv init -)" - sudo -u <%= @mastodon_user %> RUBY_CONFIGURE_OPTS=--with-jemalloc '<%= @mastodon_home %>/.rbenv/bin/rbenv' install '<%= @ruby_version %>' + if [ ! -e '<%= @mastodon_home %>/.rbenv/version/<%= @ruby_version %>/bin/ruby' ]; then + sudo -u <%= @mastodon_user %> RUBY_CONFIGURE_OPTS=--with-jemalloc '<%= @mastodon_home %>/.rbenv/bin/rbenv' install '<%= @ruby_version %>' + fi 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 echo "Configuring bundle..."