From c799f15067acb3301d52b9b6375364076c4688d4 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 12 Jan 2026 15:09:49 +1100 Subject: [PATCH] Update ruby-build with homebrew if installed This is commonly used on Mac. --- script/rbenv-install.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/rbenv-install.sh b/script/rbenv-install.sh index a6d37c8977..f92c8a1fb0 100755 --- a/script/rbenv-install.sh +++ b/script/rbenv-install.sh @@ -24,7 +24,13 @@ if rbenv install --skip-existing; then echo "Ruby is installed." else echo "Upgrading rbenv's ruby-build:" - git -C "$(rbenv root)"/plugins/ruby-build pull + # If installed with homebrew, use that to update + if (command -v brew && brew list --versions ruby-build); then + brew update && brew upgrade ruby-build + else + # Update with git + git -C "$(rbenv root)"/plugins/ruby-build pull + fi rbenv install fi