我是Vim的新手,我想使用command-t
插件,在atom中已经习惯了。我已经在github repo中做了所有的事情,但无法遵循如何更改Vim使用的ruby版本。当我尝试使用command-t
它抛出这个错误.
command-t could not load the C extension.
Please see INSTALLATION and TROUBLESHOOTING in the help
VIM Ruby version 2.0.0-p648
Expected version 2.4.1-p111
for more information type: :help command-t
除了像我说的,我有一个困难的时间以下的帮助对回购,它告诉我,没有帮助的命令t。所以我的问题是,什么是最好的方法来改变我的Vim版本?
2条答案
按热度按时间t9aqgxwy1#
请尝试以下操作:
$ cd ~/.vim/bundle/command-t/ruby/command-t/
$ rbenv local system
$ ruby extconf.rb
$ make clean
$ make
来自this的文章。我以前遇到过这个问题,这些步骤对我很有效。
vfh0ocws2#
这个错误意味着你的Vim使用的ruby版本与command-t预期的不同。与其改变Vim使用的版本,你应该做的是用vim的ruby版本重新编译command-t。
在我的例子中,我使用Homebrew安装了
vim
,它将安装自己的ruby,但没有rbenv。我也使用Pathogen作为插件,所以我在~/.vim/bundle/command-t
下安装了命令-t(由于我不使用neovim,所以检查了5-x-release
分支)。我所做的基本上是从this blog post:
which vim
给出了/opt/homebrew/bin/vim
,最终我在/opt/homebrew/opt/ruby/bin/ruby
找到了ruby。cd ~/.vim/bundle/command-t/ruby/command-t/ext/command-t
/opt/homebrew/opt/ruby/bin/ruby extconf.rb
make clean
make
在那之后,它起作用了!