"Homebrew must be run under Ruby 2.6! You're running 2.3.7" when trying to install package

I’m trying to help out a colleague. She’s trying to install a package using Homebrew and getting the error message:

Homebrew must be run under Ruby 2.6! You’re running 2.3.7.

This is on Mac OS X High Sierra 10.13.6.

I’m not sure how her Homebrew got updated to a version that requires a newer Ruby than the system Ruby and I’m not sure how to upgrade Ruby without Homebrew.

Has anyone else run into this problem or have a suggested fix?

Try updating the command line tools and see if there’s security updates?