当前位置: 动力学知识库 > 问答 > 编程问答 >

ruby - why $PATH in vim and in zsh is different?

问题描述:

in my rails app folder foo , ruby -v is ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0], but open foo in vim, :!ruby -v is ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0].

anyone can help ?

thanks !

网友答案:

Maybe, did you write $PATH in .zshrc? If so, you should use .zshenv.

.zshrc is not loaded when called script commands from vim and some applications.

Or you're using zsh on OS X. You should move /etc/zshenv to /etc/zshrc.

网友答案:

You should set your shell vim uses for running commands:

set shell=/bin/sh

You can just put it into your ~/.vimrc or run manually to test it first.

This way you will get the same environment in vim as with your interactive shell.

分享给朋友:
您可能感兴趣的文章:
随机阅读: