« Back to blog

zsh and rvm gotcha!

I decided I wanted to increase my nerd cred and try out zsh using the "Oh-My-Zsh" gem (https://github.com/robbyrussell/oh-my-zsh). While everything was fine in terms of installation, when I started to load up my apps by navigating to the appropriate directories where the .rvmrc files lives, the rvm was not set correctly.

Thankfully, two fixes got everything working. One, you'll need to edit the "lib/rvm.zsh" file and add the following lines:


if [[ -s $HOME/.rvm/scripts/rvm ]]; then
   unsetopt auto_name_dirs

   source $HOME/.rvm/scripts/rvm
fi

 

Finally, add this to your .zshrc file after the source $ZSH declaration:

[[ -s $HOME/.rvm/scripts/rvm ]] && __rvm_project_rvmrc

 

And voila! You're up and running with zsh and rvm!

Credit goes to https://github.com/tinogomes/oh-my-zsh/blob/master/lib/rvm.zsh