From memory, the ruby libraries are junkily slow. Python might work better.
You may need to
apt install rpi.gpio
although this seems to be installed by default; this command just adds python packages.
Then a command line utility is needed to wrap these calls, even from zsh:
apt install wiringpi
Then gpio should be available from the command line.