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 don't use mac or zsh (I am on linux), however I ran into this problem when I ran gvim from the MATE Menu.
I solved it by adding this to my .vimrc:
if $PATH !~ "\.rbenv"
let $PATH="/home/username/.rbenv/shims:/home/username/.rbenv/bin:" . $PATH
endif
This avoids setting it if you run vim from a terminal, otherwise the rbenv paths would be included twice.
I tried setting the application to run via a terminal, but that didn't help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With