Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I set Vim's 'embedded' ruby path?

Tags:

vim

ruby

When I run:

:ruby print VERSION

in Vim, I get 1.8.7.

I have 1.9.3 installed and I'd like to use that instead. Is there a way to change it?

Would it use the same Gem paths?

I'm not talking about the !ruby command. I'm talking about the 'embedded' Ruby that's part of Vim.

like image 649
Chris Avatar asked Dec 22 '12 16:12

Chris


2 Answers

Yes, but you'll have to recompile Vim. Vim will compile against whatever Ruby is first in your $PATH at compile time, so you should just be able to download the source and run:

./configure --enable-rubyinterp # + other options you want
make
make install

If you're on OS X using Homebrew, you may wish to just brew install vim or brew install macvim --override-system-vim.

like image 118
Andrew Marshall Avatar answered Nov 12 '22 22:11

Andrew Marshall


I have 1.9.3 installed and I'd like to use that instead. Is there a way to change it?

You would have to recompile Vim to change the version. Just Google for something including vim "--enable-rubyinterp".

Beware that you need to recompile all of your native plugins that were compiled with the old ruby version.

like image 28
Jiří Pospíšil Avatar answered Nov 12 '22 22:11

Jiří Pospíšil