Skip to content

Instantly share code, notes, and snippets.

@kaplan
Last active December 15, 2015 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaplan/5247004 to your computer and use it in GitHub Desktop.
Save kaplan/5247004 to your computer and use it in GitHub Desktop.
MacVim with RVM and Ruby 1.9.3

Install MacVim with RVM and Ruby 1.9.3

Problem: I wanted to use Vim in the Terminal (or MacVim) with Command-T and my RVM Ruby version.

Command-T documentation says it should be built using the Ruby version you intend to use in Vim/MacVim (System is recommended).

I could get the Homebrew installed version of Vim setup with my Ruby 1.9.3 along with Command-T in 1.9.3, but couldn't make it work for MacVim. So, if I tried to used Command-T in MacVim I got the Caught deadly signal SEGV error.

Originally I tried to install MacVim using Homebrew, but then in MacVim :ruby puts RUBY_VERSION will show 1.8.7 even though the brew install was done with my RVM's Ruby set to 1.9.3

I decided after asking on stackoverflow and learning about how to see mvim --version and vim --version and the Linking: to try a non brew install using the build guide for MacVim

The Key was to set the Ruby Version during configure

using a patch for the RVM Ruby version setting during the configure for MacVim build

$ cd macvim/src
$ CC=clang ./configure --with-features=huge \  
    --enable-rubyinterp --with-ruby-command=/Users/davekaplan/.rvm/rubies/ruby-1.9.3-p362/bin/ruby \  
    --enable-pythoninterp \    
    --enable-perlinterp \  
    --enable-cscope

From the patch url Bjorn says to use:

--enable-rubyinterp --with-ruby-command=/usr/local/bin/ruby

but using my version of rvm ruby, so for me it becomes

--enable-rubyinterp --with-ruby-command=/Users/davekaplan/.rvm/rubies/ruby-1.9.3-p362/bin/ruby  

You might try the the brew install for macvim, but I'm sure this works if that doesn't.

References:
http://stackoverflow.com/questions/15628883/brew-installed-vim-in-terminal-with-rvm-ruby-1-9-3-macvim-and-command-t
https://github.com/b4winckler/macvim/wiki/Building
http://vim.1045645.n5.nabble.com/MacVim-and-Ruby-RVM-td3325517.html

@dleve123
Copy link

Just ran into this same exact issue!

Before attempting to install MacVim without homebrew, I gave brew install vim a shot (I don't really care that much about the MacVim GUI and was just attempting to install it as that's where the rabbit-hole of trying to successfully install Command-T led me). It worked like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment