RVM install fails on OSX due to missing libraries

In my latest builds against OSX using RVM 2.5.1/2.5.5 I get this same error:

Libraries missing for ruby-2.5.1: /usr/local/opt/gdbm/lib/libgdbm.5.dylib,/usr/local/opt/readline/lib/libreadline.7.dylib. Refer to your system manual for installing libraries
 Mounting remote ruby failed with status 10, stopping installation.
Gemset '' does not exist, 'rvm ruby-2.5.1 do rvm gemset create ' first, or append '--create'.
The command "rvm use 2.5.1 --install --binary --fuzzy" failed and exited with 2 during .

And for 2.5.5:

Libraries missing for ruby-2.5.5: /usr/local/opt/readline/lib/libreadline.7.dylib. Refer to your system manual for installing libraries
Mounting remote ruby failed with status 10, stopping installation.
Gemset '' does not exist, 'rvm ruby-2.5.5 do rvm gemset create ' first, or append '--create'.
The command "rvm use 2.5.5 --install --binary --fuzzy" failed and exited with 2 during .

The build is therefore failing before it ever gets to the steps for running any specific code.

Got the same issue - brew updates libreadline to version 8, while some part of ruby is linked to 7. Did you find any good solution for this?

Nope, my builds remain broken.

With Run before_install or other chunk of user code before the stock installation logic, it would be possible to manually install the necessary dependencies before the Ruby installation.

For now, you can workaround this by ditching the stock installation logic with language: generic and installing Ruby by hand.

This is quite complicated. I am not optimistic that we can come up with a reasonable solution.