8

I am a noob to vim and am wanting to use the command-t plugin, got really used to that in atom. I have done everything in the github repo but am unable to follow how to change the version of ruby that my vim is using. When I try to use the command-t it throws this error...

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

Except like I said, I'm having a hard time following the help on the repo and there it tells me that there is no help for command-t. So my question is, what is the best way to change my vim version?

1 Answers1

8

Try the following:

  1. $ cd ~/.vim/bundle/command-t/ruby/command-t/
  2. $ rbenv local system
  3. $ ruby extconf.rb
  4. $ make clean
  5. $ make

Taken from this post. I've had this problem before and these steps worked for me.

garythegoat
  • 1,517
  • 1
  • 12
  • 25
  • Thank you!, that fixed it and allowed my to use command-t. One more question if I may. Will that interfere with using 2.4.1 ruby methods when writing code? or it that just something for command-t and vim? – Int'l Man Of Coding Mystery Sep 24 '17 at 21:23
  • 1
    I don't think it should interfere, but you can check your Ruby version with `$ ruby -v` – garythegoat Sep 25 '17 at 01:23
  • Ya my terminal ruby is 2.4.1. I'll jsut play it by ear and if something breaks I'll get one of the Vim gurus at my school to take a look when classes start back up next week :D Thanks again for the fix :D – Int'l Man Of Coding Mystery Sep 25 '17 at 18:11
  • 2
    I use MacVim and had a problem after upgrading to macOS Mojave where my system ruby was missing `ruby/config.h`, which caused a fatal error: `fatal error: 'ruby/config.h' file not found`. So my system ruby seemed busted. I found that MacVim was linked against Ruby 2.3.7. I installed ruby 2.3.7 via rbenv, did `rbenv shell 2.3.7` to use that version of ruby when doing steps 3,4,5 above, and was able to build Command-T properly. Each time I upgrade macOS and/or macvim, I end up having to fight to get Command-T installed again. Hopefully this helps someone else out. – Kyle Tolle Nov 14 '18 at 20:21