Vim的Ruby插件有问题 [英] Problem with Vim's Ruby plugin
本文介绍了Vim的Ruby插件有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚安装了Vim,每当我在ruby文件中打开时,都会出现以下错误:
I have just installed Vim and when ever I go to open in ruby file I get these errors:
Error detected while processing C:\Program files (x86)\Vim\vimfiles\ftplugin\ruby.vim
line: 76
Encoding::ConverterNotFoundError: code converter not found (UTF-16LE to ASCII-8bit)
line: 93
E121 :Undefined varaible: s:ruby_path
E15: Invalid expression: s:ruby_path
line: 76
NameError: uninitialized constant Gem::Quickloader
line: 93
我已经安装了Ruby 192,即使更新ruby vim文件也遇到此错误.
I have Ruby 192 installed and I get this error even if I update ruby vim files.
如果有帮助,这些错误所指的是以下两行:
These are the two lines those errors are referring to if it helps:
line 76: ruby VIM::command( 'let s:ruby_path = "%s"' % ($: + begin; require %q{rubygems}; Gem.all_load_paths.sort.uniq; rescue LoadError; []; end).join(%q{,}) )
line 93: let &l:path = s:ruby_path
推荐答案
请注意,除了编辑ruby.vim文件外,您还可以添加
Note that instead of editing ruby.vim file you can just add
let g:ruby_path = ':C:\ruby192\bin'
_vimrc
文件中的
(或与您的平台等效的文件).这样一来,您在更新ruby.vim时就无需继续对其进行编辑.
in your _vimrc
file (or equivalent for your platform). That way you won't need to keep re-editing ruby.vim when you update it.
这篇关于Vim的Ruby插件有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文