Changing PATH in zsrhc depending on the selected ruby version

660 views Asked by At

Is it possible that the PATH entries in the zshrc automatically adapt to the selected ruby version? At the moment the zshrc contains e.g.

export PATH="/Users/mariopeischl/.gem/ruby/3.1.0/bin:$PATH"
export PATH="/Users/mariopeischl/.gem/ruby/3.1.0/gems:$PATH"

If I now change the used ruby version with

$ chruby 3.0.3 

I have to change the PATH entries manually each time. Is there a way to automate this with a variable?

0

There are 0 answers