背景
プラグインが動かない!なんで!vimが古い!!
ってなって最新版を入れようと思って色々調べた際のメモ
環境
cat /etc/redhat-release ; uname -r
CentOS Linux release 7.6.1810 (Core)
3.10.0-957.el7.x86_64
インストール手順 (前準備)
ビルドにはいろいろと必要なので入れてきます。
gcc 他
$ yum install -y gcc lua-devel ncurses-devel
ruby (1.6.0以降)
$ yum install ruby-devel
# GitHubからとってくる
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
# パスを通す
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
# 初期化
$ ~/.rbenv/bin/rbenv init
# 読み込み
$ bash
# MakeFile作成時に使うのでメモしておきます
/usr/bin/ruby
ないと怒られたり
checking --with-ruby-command argument... defaulting to ruby
checking for ruby... no
configure: error: could not configure Ruby
# または
checking for /usr/bin/ruby... /usr/bin/ruby
checking Ruby version... OK
checking Ruby rbconfig... RbConfig
checking Ruby header files... not found; disabling Ruby
configure: error: could not configure Ruby
古くても怒られます
checking for /usr/bin/... /usr/bin/
checking Ruby version... too old; need Ruby version 1.6.0 or later
configure: error: could not configure Ruby
インストール
$ git clone https://github.com/vim/vim.git
$ cd vim
# 特定のバージョンは下記のように指定できる
$ git checkout v7.4.393
$ ./configure --prefix=/usr/local --with-features=huge --enable-multibyte --enable-rubyinterp --enable-luainterp --enable-cscope --enable-fail-if-missing --with-ruby-command=/usr/bin/ruby
$ make && sudo make install
$ vim --version | head -n3
VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 25 2019 16:19:07)
適用済パッチ: 1-1201
Compiled by root@localhos