From 880386bf2f19992b75c6d53df004a3ed42b1f7f5 Mon Sep 17 00:00:00 2001 From: anmol Date: Mon, 7 Jan 2019 15:36:16 +0530 Subject: [PATCH] Mastodon require ruby-build <2.6.0 --- scripts/install | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 3bae370..4af30b4 100644 --- a/scripts/install +++ b/scripts/install @@ -208,17 +208,33 @@ ynh_replace_string "#SMTP_OPENSSL_VERIFY_MODE=peer" "SMTP_OPENSSL_V # Give right permission for the app chown -R "$app": "$final_path" +# Install ruby 2.5.1 ( - cd "$final_path/live" - su mastodon <> .env.production - RAILS_ENV=production $final_path/live/bin/bundle exec rails db:migrate --quiet - RAILS_ENV=production $final_path/live/bin/bundle exec rails assets:precompile --quiet -INSTALL + exec_as "$app" $final_path/.rbenv/bin/rbenv install -s 2.5.3 || true + exec_as "$app" $final_path/.rbenv/bin/rbenv global 2.5.3 || true + exec_as "$app" $final_path/.rbenv/versions/2.5.3/bin/ruby -v +) + +# Create symlink for ruby +rm /usr/bin/ruby || true +ln -s $final_path/.rbenv/versions/2.5.3/bin/ruby /usr/bin/ruby || true + +# Preconfig CSS & JS +# Install Mastodon +( +sudo su - $app <> .env.production +RAILS_ENV=production $final_path/live/bin/bundle exec rails db:migrate --quiet +RAILS_ENV=production $final_path/live/bin/bundle exec rails assets:precompile --quiet +MCOMMANDS ) #=================================================