Make rails.vim Work: Compile VIM From Sources
Ever heard about rails.vim project? “Accept no imitations: rails .vim is the one true Vim plugin for syntax highlighing, easy navigation, and script invocation for all your Ruby on Rails applications, transparently and unobtrusively” says creator Tim Pope.
The very good “rails.vim” guide can be found here or just by reading project’s vimdoc here .
PROBLEM:
There is however one gotcha for Ubuntu Hardy Heron lovers (or other modern Linux distros). Using rails.vim would result in VIM “segmentation fault”crashes similar to:
Vim: Finished.
Aborted
REASON:
This is due to the fact that a packaged VIM that comes from some Linux distros repositories has old patches.
SOLUTION:
One of possible solutions would be to download most current VIM sources from http://www.vim.org/sources.php and compile/install it manually. Below is how it is done on Ubuntu (but should be pretty similar on any Linux distro):
1. Get vim sources:
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.1.tar.bz2
(where ‘7.1′ is the current VIM version at the moment of writing)
2. Unpack it
tar -xvjf vim-7.1.tar.bz2
3. Install terminal libraries (vim needs them to compile correctly)
sudo apt-get install libncurses5-dev
4. Configure / Compile / Install
./configure --with-features=huge make sudo make install
5. Point your system to newly compiled VIM:
sudo rm /etc/alternatives/vi sudo rm /etc/alternatives/vim sudo rm /etc/alternatives/vimdiff sudo ln -s /usr/local/bin/vim /etc/alternatives/vi sudo ln -s /usr/local/bin/vim /etc/alternatives/vim sudo ln -s /usr/local/bin/vimdiff /etc/alternatives/vimdiff
DONE
本文介绍了一个针对Ubuntu Hardy Heron用户使用rails.vim插件时遇到的VIM崩溃问题及其解决方案。该问题源于预装VIM版本过旧,通过手动编译安装最新版VIM可以有效避免崩溃情况。
1926

被折叠的 条评论
为什么被折叠?



