Why will macvim always use ruby ​​1.9.3?

I installed yadr dotfiles , vim plugin suite, ruby, etc.

I have the following line of Ruby code in a file foo.rb

:

foo: bar

Note. I used the ruby ​​1.9.3 syntax to assign / define a symbol.

When I start macvim from the command line with mvim foo.rb

and save this file everything works fine.

However, when I open macvim using open -a macvim

, and navigate and open foo.rb

, when I try to save the file, I get a ruby-vim syntax error on foo: bar

. When I change it to :foo => bar

, I don't get syntax errors.

  • Using open -a macvim

    to open macvim and then type :!ruby -v

    printsruby 1.8.7

  • Using mvim .

    to open macvim and then type :!ruby -v

    printsruby 1.9.3

Depending on how I open macvim, I get a different Ruby version. How can I ensure that macvim always uses ruby ​​1.9.3 to evaluate my ruby ​​code?

thank

+3


source to share


1 answer


It took me a while to find the fix, but the problem is caused by MacVim not loading zsh in the same way Terminal boots zsh.

The fix is ​​simple enough and can be put into your zshrc. See the commit from my dotfiles:

https://github.com/simeonwillbanks/dotfiles/commit/e0e19cfeff13f8bc99d8164217ddd84c6d7f9529

The link links for a full explanation which can be found here:



http://vim.1045645.n5.nabble.com/MacVim-and-PATH-tt3388705.html#a3392363

enter image description here

Hope this helps!

+5


source







All Articles