Browsing articles from "October, 2014"
Oct
8

Recovering My MacVim

By Rob Warner  //  Development, Mac, Ruby, Software  //  No Comments

Although I usually edit files with (graphical) MacVim, I occasionally launch terminal vim. When I do, I see this:

github-issues.vim requires Python support, sorry :c

I always smile a bit at my nephew’s use of an extra-frowny mouth, but I also wince a bit to know that I’m letting this issue linger, rather than fix it.

The simplest fix is to use terminal macvim as my system vim, so last Friday I opted for what I expected to be the easy route and typed:

brew uninstall macvim
brew install macvim --override-system-vim

My system churned a bit while I watched the github-issues.vim animated GIFs, and then reported:

if_ruby.c:677: error: 'rb_encoding' undeclared (first use in this function)

Years of raising children has taught me that I can’t expect proper results without diligent monitoring, so I ran the install command again, but this time I watched it like a hawk, and actually expected different results. After the same system churn, of course, I got the same result. Then my stomach began to churn a bit, and I downloaded the MacVim source from GitHub, followed the build instructions, and got the same result. 

I’m nursing this work laptop, a 2010 MacBook Pro with Snow Leopard, along until I come due for one of the shiny new retina MacBook Pros with Mavericks. I may not get one until they sport Yosemite, though, and I don’t think they plan to upgrade the OS on this laptop. You never really want to get on IT’s radar anyway, because them looking closer at your work-issued gear tends to go in directions you didn’t anticipate (“Is that the approved wallpaper? Is Homebrew even approved? Are you running a web server on here???”). What this means, though, is that I can’t use any of the latest editors (Sublime Text 3, Atom) because they’re not supported on Snow Leopard. Which means I can run Sublime Text 2 (Vintage mode, of course), but for some reason its display goes wonky on my laptop, and I really didn’t feel like investigating display glitches in a dead-ended editor. Besides, I’ve got my vim set up perfectly with settings and plugins, and anything else is a step backwards.

So, I opened the source code referenced in the error message. Line 677 of if_ruby.c was housed in this block:

673: #ifdef RUBY19_OR_LATER
674:   int isnum;
675:   long lval;
676:   char_u *sval;
677:   rb_encoding *enc;

Hmm . . . I remembered that last week I’d installed Ruby 2.1.3 via rvm. Before that, though, I was definitely using at least Ruby 1.9, so I was a bit confused, but really all I wanted to do was get MacVim working and go home. It was Friday evening, after all. So I typed:

rvm use system

This took me to ruby 1.8.7. Then I typed:

brew install macvim --override-system-vim

This time, after the churn, I got a successful completion, and now MacVim runs and vim uses terminal macvim and github-issues.vim no longer gives me the turbo frown.

And if you’re from my IT department and are reading this, I have only the company-issued wallpaper, I’m totally joking about Homebrew, and I don’t know what a web server is. And can I get a shiny new rMBP with Yosemite?

About

I'm Rob Warner, and I'm a software developer. I live in Jacksonville, Florida, and work for Availity, LLC. The postings on this site are my own and do not necessarily reflect the views of Availity.