Trying to compile vim on OS X?

别来无恙 提交于 2019-12-05 10:46:06

Says right in the blog post:

you’ve probably fallen prey to a (currently) not very well documented issue: Vim 7.2 does not support the integration of Ruby 1.9.x on Snow Leopard.

There's more information available in this ticket.

But in summary, you have to link against Ruby 1.8.7, which is the version that ships with Snow Leopard anyway.

Vim can't be compiled with Ruby 1.9.X (may be fixed in the future). You have to compile it with Ruby 1.8.X, if you want to use ruby integration.

If you use rbenv instead of rvm, you can change to ruby 1.8.7 or disable rbenv in your .zshenv or .bash_profile file, recompile vim and enable your current ruby again. This should work for OSX 10.6 too. I've tested this solution on OSX 10.7 and 10.8 only.

For zsh and rbenv:

# disable in your .zshenv for compile time. Just comment it out for comile time.
# eval "$(rbenv init -)"

For bash and rbenv:

# disable in .bash_profile or .bashrc for compile time. Just comment it out for comile time.
# eval "$(rbenv init -)"

For rvm, you can switch to system ruby (osx), recompile and switch back

rvm use system
brew uninstall vim
brew install vim
rvm use 1.9.3

I would recommend using MacPorts; compiling vim then becomes:

$ sudo port install vim

EDIT: Correction; you would need the ruby mode:

$ sudo port install vim +ruby

MacPorts will then fetch all dependencies and sort all that headache out itself.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!