Ruby-build: Installing 2.6.7 on macOS 11.2.3 fails with implicit-function-declaration error

Created on 6 Apr 2021  路  4Comments  路  Source: rbenv/ruby-build

$ 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

Most helpful comment

Try with CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.7

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noraj picture noraj  路  4Comments

JDutil picture JDutil  路  3Comments

marvindanig picture marvindanig  路  5Comments

arpitchauhan picture arpitchauhan  路  4Comments

florentmorin picture florentmorin  路  5Comments