Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim Command-T plugin error: could not load the C extension

Tags:

vim

plugins

ruby

I'm trying to install the Command-T plugin.

I compiled vim following the instructions in this comment: Installing vim with ruby support (+ruby)

So now there's the +ruby flag, but still when I try to use the plugin I get this error:

command-t.vim could not load the C extension
Please see INSTALLATION and TROUBLE-SHOOTING in the help              
For more information type:    :help command-t

I have ruby on my system:

> ruby -v
> ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

suggestions?

like image 315
Carlo Avatar asked Oct 27 '11 22:10

Carlo


3 Answers

Go to plugin dir and run the following command:

rake make

It compiles the plugin extension you need.

like image 121
lucapette Avatar answered Nov 03 '22 12:11

lucapette


I ran into the same error but after reading the manual a bit more thorough I found the following helpful.

Tagged from the INSTALLATION section in https://github.com/wincent/Command-T

The C extension must then be built, which can be done from the shell. If you use a typical |'runtimepath'| then the files were installed inside ~/.vim and you can build the extension with:

cd ~/.vim/ruby/command-t/ext/command-t
ruby extconf.rb
make
like image 31
peralmq Avatar answered Nov 03 '22 10:11

peralmq


You must perform the build using the same version of Ruby that Vim itself is linked against.

Are you using RVM or rbenv? Personally, I was using rbenv and MacVim. I had this error because I was trying use ruby 1.8.7 patch 352. I switched back to 1.8.7 patch 249 using rbenv shell system before running ruby extconf.rb and make, then everything worked fine.

Afterwards, you can revert your shell back using rbenv shell --unset.

like image 4
Mike Avatar answered Nov 03 '22 12:11

Mike