Last Updated: February 25, 2016
·
1.017K
· sheerun

Force specific ruby version for any command.

I had problem with git-upgem: this command works only for ruby 1.9.3 whereas my project still runs on 1.8.7. I use rbenv for ruby version management.

The solution is to define an alias that forces specific ruby version:

alias up='RBENV_VERSION=1.9.3-p362 git up'

From now on, it doesn't matter from where you run up command.