Problems installing CommandT in windows

After completing all the installation steps for the CommandT plugin, I get the error command-t.vim could not load the C extension at startup. The ComamndT troubleshooting section provides the following recommendations:

 If a problem occurs the first thing you should do is inspect the output of: ruby extconf.rb make During the installation, and: vim --version And compare the compilation and linker flags that were passed to the extension and to Vim itself when they were built. If the Ruby-related flags or architecture flags are different then it is likely that something has changed in your Ruby environment and the extension may not work until you eliminate the discrepancy. 

And indeed, it seems to me that there is a mismatch.

Exiting make suggests that cygwin gcc uses ruby ​​1.8:

 gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA VE_RUBY_H -g -O2 -std=c99 -Wall -Wextra -Wno-unused-parameter -c ext.c gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA VE_RUBY_H -g -O2 -std=c99 -Wall -Wextra -Wno-unused-parameter -c match.c gcc -I. -I/usr/lib/ruby/1.8/i386-cygwin -I/usr/lib/ruby/1.8/i386-cygwin -I. -DHA VE_RUBY_H -g -O2 -std=c99 -Wall -Wextra -Wno-unused-parameter -c matcher.c gcc -shared -s -o ext.so ext.o match.o matcher.o -L. -L/usr/lib -L. -Wl,--enabl e-auto-image-base,--enable-auto-import,--export-all -lruby -ldl -lcrypt 

Exiting vim :version contains this output:

 -DDYNAMIC_RUBY_VER=191 -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby191.dll\" 

The troubleshooting guide suggests using a combination of Vim 7.2, Ruby 1.8.7-p299 and DevKit 3.4.5r3-20091110. However, this is not a good solution for me for a number of reasons:

  • I am using Vim 7.3 and would like to continue to do this.
  • Ruby 1.9.3 is installed on my system, and I need it in PATH for other projects.

So, is there a way to get this working while keeping the latest version of ruby ​​and the latest version of vim?

UPDATE

Following the advice of AndrewMarshall, I installed Ruby191 and DevKit-4.5.0-201001919-1536-sfx.exe according to this tutorial and run ruby extconf.rb through this version. make cmd completed successfully with this output:

 gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1 .9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H -O2 -g - Wall -Wno-parentheses -std=c99 -Wall -Wextra -Wno-unused-parameter -o ext.o -c ext.c gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1 .9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H -O2 -g - Wall -Wno-parentheses -std=c99 -Wall -Wextra -Wno-unused-parameter -o match.o -c match.c gcc -I. -IC:/Ruby191/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby191/include/ruby-1 .9.1/ruby/backward -I/C/Ruby191/include/ruby-1.9.1 -I. -DHAVE_RUBY_H -O2 -g - Wall -Wno-parentheses -std=c99 -Wall -Wextra -Wno-unused-parameter -o matcher. o -c matcher.c gcc -shared -s -o ext.so ext.o match.o matcher.o -L. -LC:/Ruby191/lib -L. -Wl,- -enable-auto-image-base,--enable-auto-import -lmsvcrt-ruby191 -lshell32 -lws2 _32 

and start :CommandT in vim works now, but as soon as I start typing in the text to search for the file, and then press Enter to select and open it, I get the following: Vim crashing

+4
source share
2 answers

not a real answer, but you can try ctrlp .

  • written in vimscript (no dependency, no compilation)
  • as fast as CommandT (subjective to me)
  • has more features than CommandT (does CommandT most recent file?)

There is also the good old FuzzyFinder , which I have not tried. It looks like it has not been updated for about 2 years, but it can still work.

+4
source

I have successfully installed the latest command-t on vim 8.0 on Windows 10. And I find this question when I work on it, so I am going to post my solution, although it is a bit late.

Ruby for vim 8.0 - Ruby 2.2. Therefore, download and install Ruby 2.2 and Ruby Devkit (do not forget to run ruby dk.rb init and ruby dk.rb install for devkit ).

Then I follow the command-t command to execute ruby extconf.conf , but it failed - it displays You have to install development tools first. even if I installed it:

I searched for this problem. Find RubyInstaller wiki says that I have to execute this command by adding -rdevkit and I did it. This succeeds when I execute ruby -rdevkit extconf.rb but failed when make . So, I searched googled again and found another way to compile it:

rake make -rdevkit

And it worked. Here is my screenshot:

enter image description here

+1
source

All Articles