macvim为什么不总是使用ruby 1.9.3? [英] Why won't macvim always use ruby 1.9.3?
问题描述
我已经安装 YADR点文件时,一组VIM的,红宝石等的插件.
I have installed yadr dotfiles, a set of vim, ruby, etc plugins.
我的Ruby代码下面的行中一个文件
I have the following line of Ruby code in a file foo.rb
:
foo: bar
请注意我用红宝石1.9.3语法符号分配/定义.
Note I used the ruby 1.9.3 syntax for symbol assignment/definition.
当我使用命令行启动的MacVim
When I start macvim from command line using mvim foo.rb
and save that file, everything works fine.
然而,当使用
However, when I open macvim using open -a macvim
and navigate to 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.
- 使用
到开放的MacVim,然后进入 打印 - 使用
到开放的MacVim,然后进入 打印
根据我怎么开的MacVim,我得到了不同版本的Ruby 的.如何保证的MacVim总是使用红宝石1.9.3评价我的Ruby代码?
Depending on how I open macvim, I get a different version of Ruby. How do I ensure that macvim always uses ruby 1.9.3 to evaluate my ruby code?
谢谢
推荐答案
我花了一段时间来寻找一个解决,但问题是由不的MacVim的zsh加载同样的方式终端负载的zsh引起的.
It took me awhile to find a fix, but the issue is caused by MacVim not loading zsh the same way Terminal loads zsh.
该修复非常简单,可以放入您的zshrc中.看到从我的点文件提交:
The fix is easy enough and can be placed into your zshrc. See a commit from my dotfiles:
https://github.com/simeonwillbanks/dotfiles/commit/e0e19cfeff13f8dcd43c
https://github.com/simeonwillbanks/dotfiles/commit/e0e19cfeff13f8bc99d8164217ddd84c6d7f9529
在提交的引用,其可以在这里找到的完整说明:
The commit references a full explanation which can be found here:
HTTP://vim.1045645.n5 .nabble.com/的MacVim和 - PATH-tt3388705.html#a3392363
希望这会有所帮助!
这篇关于macvim为什么不总是使用ruby 1.9.3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!