Command-T不会为Vim编译

Mor*_*ris 3 vim

我正在尝试为Vim安装Command-T,但到目前为止没有成功。

我使用brew重新安装了vim,而vim的ruby版本是2.5.1。

我使用RVM安装了ruby 2.5.1,我运行了ruby ruby​​ extconf.rb,我得到了这个输出

checking for float.h... yes
checking for ruby.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for fcntl.h... yes
checking for stdint.h... yes
checking for sys/errno.h... yes
checking for sys/socket.h... yes
checking for ruby/st.h... yes
checking for st.h... yes
checking for pthread_create() in -lpthread... yes
creating Makefile
Run Code Online (Sandbox Code Playgroud)

然后我跑了就知道了:

compiling ext.c
compiling heap.c
compiling match.c
compiling matcher.c
compiling watchman.c
linking shared-object ext.bundle
Run Code Online (Sandbox Code Playgroud)

但是,当我尝试在vim上使用它时,收到以下消息:

command-t.vim could not load the C extension.
Please see INSTALLATION and TROUBLE-SHOOTING in the help.
Vim Ruby version: 2.5.1-p57
For more information type:    :help command-t
Run Code Online (Sandbox Code Playgroud)

如果我使用2.5.0版的ruby进行编译,则消息会提示我得到了错误的ruby版本。

我不知道还能做什么,请帮帮我

iam*_*mdi 6

问题是,你必须编译命令-T ç扩展使用相同的红宝石作为VIM编译。

您提到您正在使用RVM,并且vim是用ruby 2.5.1-p57编译的。您需要选择完全相同的红宝石。如果您使用RVM中的 ruby 2.5.1-p57 编译(在您的情况下安装了brew)vim,则运行命令:

$ rvm use 2.5.1-p57
Run Code Online (Sandbox Code Playgroud)

然后重新编译命令-t,确保ruby -v返回2.5.1-p57:

$ ruby -v

$ ruby extconf.rb

$ make
Run Code Online (Sandbox Code Playgroud)

如果这样做没有帮助,可能是您使用与2.5.1版本相同的系统级红宝石安装了它。这样可以解决问题:

$ rvm use system

$ ruby extconf.rb

$ make
Run Code Online (Sandbox Code Playgroud)

这个想法编译命令-T相同版本的红宝石作为VIM编译。

在更坏的情况下,您可以重新安装vim。

您也可以参考命令-t docs