Yes I'm using rbenv. My rbenv path is /usr/local/bin/rbenv . The code works if I add "global COMMAND_PREFIX" to your new function. Otherwise it doesn't work at all.