Making RVM work with Zsh and Vim
I’m not going to say how long it took me to figure this out. I wanted RVM to work with Zsh and Vim. But when I ran ruby commands with :! or :sh, it would always use the system ruby, not the ruby I had selected with RVM.
Here’s what finally worked:
- I added
SHELL=/bin/zshand[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"to ~/.zshrc - I commented out the
path_helperstuff in /etc/zshenv
This makes Vim run zsh instead of bash when running shell commands and prevents Apple’s path_helper utility from rearranging PATH when zsh is run.