Fix SEGV for Vims command t on Ubuntu 12.10

The upgrade to Ubuntu 12.10 upgraded my Ruby version to 1.9.3 (yay!).

This, however, broke my command-t a vim-plugin to open files quickly. Command-t is a compiled plugin (for speed) and needs to be compiled against the system-wide Ruby. Else vim crashes with a SEGV.

A little searching, showed me that command-t was the problem and needed to be recompiled. Obviously only when you had installed command-t before the upgrade to 12.10 (and thus compiled against the previous ruby version). As nearly always, once you know the problem, the fix is easy on Ubuntu; the Vim and gVim are already compiled against the correct library.

First, checking what version command-t is compiled against:

  $ ldd ~/.vim/bundle/command-t/ruby/command-t/ =>  (0xb7714000) => /usr/lib/ (0xb7696000) => /lib/i386-linux-gnu/ (0xb7330000) => /lib/i386-linux-gnu/ (0xb7314000) => /lib/i386-linux-gnu/ (0xb730b000) => /lib/i386-linux-gnu/ (0xb7306000) => /lib/i386-linux-gnu/ (0xb72d5000) => /lib/i386-linux-gnu/ (0xb72a9000)
  /lib/ (0xb7715000)

Hmm., not good.

Cd into the command-t location (mine is at ~/.vim/bundle/command-t/), feth the lastest version, clean the old make and re-make. In order to re-make I use the rakefile, you might have to install rake first. And, important, make sure you run the system ruby if using gemsets. Like so:

  $ rvm use system
  $ ruby -v && which ruby # Just to know what we are using.
  $ sudo gem install rake # We need rake to build.

  $ cd ~/.vim/bundle/command-t/
  $ git pull --rebase origin && git checkout master

  $ make clean # remove old compilations and installation
  $ rake make  # rebuild the 

And there you go:

  $ ldd ~/.vim/bundle/command-t/ruby/command-t/ =>  (0xb7714000) => /usr/lib/ (0xb74da000)

Happy command-t-ing.

Woodcut from Doré. Purely illustrative
Doré Woodcut. Its only function is to make the layout look better. And these images are really nice themselves

About the author: Bèr Kessels is an experienced webdeveloper with a great passion for technology and Open Source. A golden combination to implement that technology in a good and efficient way. Follow @berkes on Mastodon. Or read more about Bèr.