问题描述
我在 Windows 7 上使用 Vim 7.3.当我尝试打开 .rb 文件时出现此错误.Vim(ruby):NoMethodError:未定义C:/Ruby192/lib/ruby/gems/1.9.1"的方法`规范':字符串按 Enter 后文件会打开,但没有语法突出显示.我有以下 vim 插件: rails.vim around.vim nerd_tree.vim nerdcommenter.vim snipmates.vim
I'm using Vim 7.3 on Windows 7. When I try to open a .rb File i get this error. Vim(ruby):NoMethodError: undefined method `specifications' for "C:/Ruby192/lib/ruby/gems/1.9.1":String The file opens after I press Enter, but with no syntax highlighting. I have the following vim plugins: rails.vim surround.vim nerd_tree.vim nerdcommenter.vim snipmates.vim
推荐答案
我不确定问题是否出在 vim 插件之一上.我刚刚安装了你在win7中提到的所有插件,我没有这样的问题.但是,当我使用 rubygems 1.8.5 时,重现了类似的错误,并且我尝试运行 rake 任务.这是一个讨论相同 rubygems 错误的论坛链接 链接
I'm not sure if the problem is with one of the vim plugins. I just installed all the plugins you mentioned in win7 and I have no such problem. However I had a similar error reproduced when I had rubygems 1.8.5, and I tried to run a rake task. Here is a link to a forum that talks about that same rubygems error link
要找出您的版本,请运行
To find out your version, run
gem -v
我们的解决方案是降级 rubygems
The solution for us was to downgrade rubygems
gem update --system 1.7.2
@Tyler-long 告诉我,Ruby Gems 修复了这个问题,升级也修复了这个错误.然后你可以这样做:
@Tyler-long is telling me, that Ruby Gems fixed the problem, and an upgrade also fixes the bug. Then you can just do:
gem update --system
这篇关于Vim(ruby):NoMethodError: 未定义的方法“规范"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!