2009年2月23日月曜日

Ruby/RailsのためのVim導入(その1)

CentOSに付属のvim(vi)は、rubyオプションが有効になっていないので
vim-rubyを導入しても正しく動作しない。
よってvimの最新版をソースから導入する事にした。

作業前に、vimのrubyオプションが無効な事を確認

$ vim --version | grep ruby
+python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
つ´Д`)つ


ソースをダウンロード
$ wget ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2
$ wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-extra.tar.gz
$ wget ftp://ftp.vim.org/pub/vim/extra/vim-7.2-lang.tar.gz
$ tar xvfj vim-7.2.tar.bz2
$ tar xvfz vim-7.2-extra.tar.gz
$ tar xvfz vim-7.2-lang.tar.gz

パッチをダウンロード
※ブラウザで、ftp://ftp.vim.org/pub/vim/patches/7.2/ にアクセスして、最新の番号を確認する
$ mkdir patches
$ cd patches
$ wget ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.001-100.gz
$ curl -O 'ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.[101-124]'
$ cd ../vim72
$ zcat ../patches/7.2.* | patch -p0

configure
※--enable-rubyinterp を付ける

$ ./configure --enable-perlinterp --enable-pythoninterp --enable-tclinterp \
> --enable-rubyinterp --enable-multibyte --enable-xim --enable-fontset \
> --with-features=big --prefix=$HOME 2>&1 | tee config.log

makeして導入
$ make 2>&1 | tee make.log
$ make install
(prefixが、/usr/local とかならsudoを付ける)

確認
$ $HOME/bin/vim --version | grep ruby
+printer -profile +python +quickfix +reltime +rightleft +ruby +scrollbind

・-)

参照(っていうか、そのまんま・・・)
http://www.hazama.nu/t2o2/archives/002696.html