Help us understand the problem. What is going on with this article?

El capitan の Homebrew で vim が入らない

More than 5 years have passed since last update.

Mac の Vim でクリップボードの連携が効かないとき, ビルド時のオプションが抜けているのが問題なので, /usr/bin/vim ではなく, Homebrew を使ってビルドした Vim に切り替えることで解決しようという記事があったので,brew install vimしてみるも,うまくいかない.

$ brew install vim
Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
==> Downloading https://mirrors.kernel.org/debian/pool/main/v/vim/vim_7.4.712.orig.tar.gz

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "vim"
Download failed: https://mirrors.kernel.org/debian/pool/main/v/vim/vim_7.4.712.orig.tar.gz

書いてあるようにサポート外でビルドが通らないとかならまだしも,親に向かって The requested URL returned error: 404 Not Found とはなんだ,となる.

実際 404 Not Found なのが原因ではなかった.後輩に聞くと,こういうときはとりあえず brew doctor するらしい.

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: The /usr/local is not writable.

You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami) /usr/local

...

El Capitan だと,/usr/local が自由にできなくなったとかで,権限を与えてやる必要があるらしい.言われるがままに sudo chown -R $(whoami) /usr/local (そのままコピペしてOK) すると,できるようになった.

$ brew install vim
==> Downloading https://github.com/vim/vim/archive/v7.4.922.tar.gz
==> Downloading from https://codeload.github.com/vim/vim/tar.gz/v7.4.922
######################################################################## 100.0%
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.922/share/man --enable-multibyte --with-tlib=ncurses --enable-cscope --with-features=huge --with-compiledby=Homebrew --enable-perlinterp --enable-pythoninterp --enable
==> make
==> make install prefix=/usr/local/Cellar/vim/7.4.922 STRIP=true
🍺  /usr/local/Cellar/vim/7.4.922: 1620 files, 26M, built in 48 seconds

(おそらくアーカイブを保存するのも /usr/local 以下なのでダウンロードできなかった,みたいな理由だと思ったのだが,何故かしれっとダウンロード元も変わっているのは謎)

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away