@@ -220,7 +220,7 @@ MACOS_NEWEST_UNSUPPORTED="16.0"
220
220
MACOS_OLDEST_SUPPORTED=" 13.0"
221
221
222
222
# For Homebrew on Linux
223
- REQUIRED_RUBY_VERSION=2.6 # https://github.com/Homebrew/brew/pull/6556
223
+ REQUIRED_RUBY_VERSION=3.4 # https://github.com/Homebrew/brew/pull/19779
224
224
REQUIRED_GLIBC_VERSION=2.13 # https://docs.brew.sh/Homebrew-on-Linux#requirements
225
225
REQUIRED_CURL_VERSION=7.41.0 # HOMEBREW_MINIMUM_CURL_VERSION in brew.sh in Homebrew/brew
226
226
REQUIRED_GIT_VERSION=2.7.0 # HOMEBREW_MINIMUM_GIT_VERSION in brew.sh in Homebrew/brew
@@ -421,8 +421,8 @@ test_ruby() {
421
421
fi
422
422
423
423
" $1 " --enable-frozen-string-literal --disable=gems,did_you_mean,rubyopt -rrubygems -e \
424
- " abort if Gem::Version.new(RUBY_VERSION.to_s.dup).to_s.split('.').first(2) != \
425
- Gem::Version.new('${REQUIRED_RUBY_VERSION} ').to_s.split('.').first(2) " 2> /dev/null
424
+ " abort if Gem::Version.new(RUBY_VERSION) < \
425
+ Gem::Version.new('${REQUIRED_RUBY_VERSION} ')" 2> /dev/null
426
426
}
427
427
428
428
test_curl () {
@@ -489,7 +489,7 @@ find_tool() {
489
489
}
490
490
491
491
no_usable_ruby () {
492
- [[ -z " $( find_tool ruby) " ]]
492
+ [[ -z " $( find_tool ruby) " ]] || ! ruby -e " require 'erb' "
493
493
}
494
494
495
495
outdated_glibc () {
@@ -498,17 +498,22 @@ outdated_glibc() {
498
498
version_lt " ${glibc_version} " " ${REQUIRED_GLIBC_VERSION} "
499
499
}
500
500
501
- if [[ -n " ${HOMEBREW_ON_LINUX-} " ]] && no_usable_ruby && outdated_glibc
501
+ if [[ -n " ${HOMEBREW_ON_LINUX-} " ]] && no_usable_ruby
502
502
then
503
- abort " $(
504
- cat << EOABORT
503
+ if outdated_glibc
504
+ then
505
+ abort " $(
506
+ cat << EOABORT
505
507
Homebrew requires Ruby ${REQUIRED_RUBY_VERSION} which was not found on your system.
506
508
Homebrew portable Ruby requires Glibc version ${REQUIRED_GLIBC_VERSION} or newer,
507
509
and your Glibc version is too old. See:
508
510
${tty_underline} https://docs.brew.sh/Homebrew-on-Linux#requirements${tty_reset}
509
511
Please install Ruby ${REQUIRED_RUBY_VERSION} and add its location to your PATH.
510
512
EOABORT
511
- ) "
513
+ ) "
514
+ else
515
+ export HOMEBREW_FORCE_VENDOR_RUBY=1
516
+ fi
512
517
fi
513
518
514
519
# Invalidate sudo timestamp before exiting (if it wasn't active before).
0 commit comments