$ rbenv install 2.6.7
Downloading ruby-2.6.7.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.7.tar.bz2
Installing ruby-2.6.7...
ruby-build: using readline from homebrew
BUILD FAILED (macOS 11.2.3 using ruby-build 20210405)
Inspect or clean up the working tree at /var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T/ruby-build.20210405221855.58365.yB7Rhg
Results logged to /var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T/ruby-build.20210405221855.58365.log
Last 10 log lines:
rb_native_mutex_destroy(&vm->waitpid_lock);
^
vm.c:2489:34: warning: expression does not compute the number of elements in this array; element type is 'const int', not 'VALUE' (aka 'unsigned long') [-Wsizeof-array-div]
sizeof(ec->machine.regs) / sizeof(VALUE));
~~~~~~~~~~~~~~~~ ^
vm.c:2489:34: note: place parentheses around the 'sizeof(VALUE)' expression to silence this warning
compiling addr2line.c
1 warning and 1 error generated.
make: *** [vm.o] Error 1
make: *** Waiting for unfinished jobs....
From /var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T/ruby-build.20210405221855.58365.log:
vm.c:2295:9: error: implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
rb_native_mutex_destroy(&vm->waitpid_lock);
^
compiler:
$ clang -v
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Try with CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.7
That works, maybe it should be included in ruby-build for now until ruby can fix the issue in the source.
We already filed this. https://bugs.ruby-lang.org/issues/17777
Duplicated at https://github.com/rbenv/ruby-build/issues/1489
Most helpful comment
Try with
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.7