Ruby gems can run anything at install time.
I know of some that download C sources from github and compile them as part of the install (not build) process.