Gangmax Blog

RVM and zsh

After installing zsh & oh-my-szh, RVM does not work properly, reporting the following error:

1
2
3
Warning: PATH set to RVM ruby but GEM_HOME and/or GEM_PATH not set, see:

https://github.com/wayneeseguin/rvm/issues/3212

Finally I found the root cause is that, after install zsh & oh-my-szh, and set zsh as the default shell, the “.zshrc” file contains the “$PATH” with all the PATH content of “.bashrc”, which also inludes the “rvm” related path items. However, this will cause the problem above. The correct solution is remove all the path items in the “$PATH” variable, and add the two line about RVM at the end of the “.zshrc” file just as the “.bashrc” file.

1
2
3
# Add RVM.
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

Comments