Tuesday, 10 September 2013

Loading Ruby in Vim

Loading Ruby in Vim

I've had some trouble getting Ruby setup properly in Vim, I have found a
solution so I wanted to post it here so that it might help others, but
also to see if there are alternative solutions.
I'm using Vim 7.4 (http://www.vim.org/download.php, self-installing
executable), Ruby 192 (rubyinstaller.org), Win 7.
In Vim :version gives... +ruby/dyn and also -DDYNAMIC_RUBY_DLL
msvcrt-ruby192.dll
I installed vim-ruby using vundle. However, when trying to verify the
installation as explained here ...
https://github.com/vim-ruby/vim-ruby/wiki/VimRubySupport I found that
omnicomplete failed... E764: Option 'omnifunc' is not set
In Vim trying ... :echo has('ruby') returned 0 indicating that ruby has
not been loaded.
After reading various posts etc I suspected that the problem may be due to
the naming of "C:\Ruby192\bin\msvcrt-ruby191.dll"
So I changed this file name to msvcrt-ruby192.dll, retarted Vim and
everything worked.
Another solution that also works is to not change this file name, but
instead edit gvim.exe and find the reference to this dll and change it to
msvcrt-ruby191.dll
In the end I went with this second solution, I guess this could have been
done by building Vim with all the proper settings etc, but that is for
another day.
I'd be interested to hear your comments - Thanks!

No comments:

Post a Comment