Recibo el siguiente error cuando intento actualizar Ruby a 2.6.7:
$ rbenv install 2.6.7 ... implicit declaration of function 'rb_native_mutex_destroy' is invalid in C99 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¿Hay una solución?
Sí, este es un problema conocido aguas arriba: https://bugs.ruby-lang.org/issues/17777
ruby-build también está rastreando este problema: https://github.com/rbenv/ruby-build/issues/1489
La solución es ejecutar el siguiente código e instalar Ruby 2.6.7 nuevamente:
$ export warnflags=-Wno-error=implicit-function-declaration $ rbenv install 2.6.7 -or- $ CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.7 Parece que esto también puede afectar la instalación de gemas con extensiones nativas ( mysql2 es una de ellas):
gem install <GEMNAME> -- --with-cflags="-Wno-error=implicit-function-declaration"Además de seguir la respuesta de Gavin, tuve que reinstalar readline. brew reinstall readline