エラー内容
% rbenv install 2.6.7
Downloading openssl-1.1.1k.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5
Installing openssl-1.1.1k...
Installed openssl-1.1.1k to /Users/Username/.rbenv/versions/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.1 using ruby-build 20210423)
Inspect or clean up the working tree at /var/folders/21/ntlh79kd1yvfz2gwv8n79f4c0000gn/T/ruby-build.20210427115224.72475.T0ZRPY
Results logged to /var/folders/21/ntlh79kd1yvfz2gwv8n79f4c0000gn/T/ruby-build.20210427115224.72475.log
Last 10 log lines:
compiling dmyenc.c
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
3 warnings and 1 error generated.
make: *** [vm.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
1 warning generated.
解決方法
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.7
を実行することで解決できます。