I use plain Vim with ruby support on Lion (installed by gist). I am using ruby with rbenv so my path looks like /users/me/.rbenv/shims:…..
From within vim the path is
:!echo $PATH
> usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/fb/.rbenv/shims:....
Even I can create and modify an environment variable:
:let $PATH = "/bar:/foo"
:!echo $PATH
> /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/foo:/bar
paths remains starting with /usr/bin.
So how can I access my ruby 1.9.3 in ~/.rbenv/shims instead the system ruby in /usr/bin ?
I did’n t set the
shelloption in .vimrc, so that it was automatically set to/bin/zsh.Then I found out that I hab a dublicate initialisation of rbenv: in my .zshrc. I removed the initialisation end $PATH extensioin in
.zshrcbecause that was already handled by the oh-my-zsh rbenv plugin.Even after that cleanup, the $PATH mangeling still happening so
:!echo $PATHSetting
:set shell=/bin/bashwas what helped me, as i can live with bash in my vim::!echo $PATH