Open sanjioh opened 1 week ago
Thank you for reporting. This is strange, and I'm glad the error is at least non-fatal.
If you paste the following code into a bash shell, what does it output? (You could paste it into zsh too; it will likely work.)
brew list 2>/dev/null | grep '^openssl@' | while read -r formula; do
prefix="$(brew --prefix "$formula" 2>/dev/null || true)"
[ -n "$prefix" ] || continue
version="$("$prefix"/bin/openssl version 2>/dev/null | sed -n 's/OpenSSL \([0-9][0-9.]*\).*/\1/p')"
[ -z "$version" ] || printf '%s %s %s\n' "$formula" "$version" "$prefix"
done
Hi, thanks for replying.
The output is:
openssl@3 3.3.2 /usr/local/opt/openssl@3
Thanks for checking. That looks okay, so I actually don't know what triggers the "bad array subscript" error. However, I do think that ruby-build is trying to access an array at index -1
somehow, so I could add a guard around that, even if I don't understand how that index happened to be.
Steps to reproduce the behavior
rbenv install 2.7.8
Expected vs. actual behavior
I get the error
/usr/local/bin/ruby-build: line 1158: versions: bad array subscript
, right after issuing the command, which I suppose should not happen. The error is not blocking (build completes successfully).Logs
This happens on an Intel Mac with macOS 14.7, ruby-build installed from Homebrew.