Installing Vim with Ruby Support (+Ruby)

Cygwin: Installing vim with ruby support

Ruby support fixed in Cygwin ViM: vim-8.0.1486-1.

You should also have the latest ruby installed: ruby-2.3.6,

and also do not forget to rebuild the dynamic library for command-t.

Note: You can find the discussion on the cygwin mailing list here.

Which Ruby does Vim use for :ruby commands?

All this depends on Vim build configuration. :ver output may indicate the following:

  • -lang interface for "lang" wasn't compiled at all;
  • +lang everything was statically linked into Vim executable;
  • +lang/dyn interface was linked against dynamic library (dll/so)

If it's linked dynamically then the library will be searched and loaded on demand by option value (e.g. :h 'rubydll'). In this case it may point to any installation you want. (Although -DRUBY_VERSION=XX specified at compile-time may still be relevant and Vim may fail to load mismatched library).

Installing Vim with the Ruby Interpreter

You just need to install ruby header files first. Like this:

sudo apt-get install ruby-dev
./configure --enable-rubyinterp

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

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.

How to change vim ruby version

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.

Install Ruby support for VIM on Mac OS X

While it's possible to build and install your own Vim to replace the pre-installed version, I don't recommend it. It's far easier to just use MacVim instead:

http://code.google.com/p/macvim/

MacVim is a very Mac-friendly version of Vim, and it's got Ruby support already built in. It can be used as both a GUI and Terminal application. (Check out :help macvim-start from within MacVim for details.)



Related Topics



Leave a reply



Submit