読者です 読者をやめる 読者になる 読者になる

Shoken Startup Blog

KitchHikeを作っています。ひとつずつアウトプットします。

brewでのNeoVimインストールでエラー /usr/local/Library/ENV/4.3/sed: No such file or directory

Vim Mac

f:id:sfujisak:20160717201904p:plain

HomebrewでのNeoVimのインストールでハマったのでメモ。

結論

libtool を再インストールすると、エラーが出なくなりインストールできるようになった。

brew update
brew reinstall -s libtool
brew install neovim/neovim/neovim

環境

  • Mac OS X El Capitan 10.11.5
  • NeoVim 0.1.4
  • Homebrew 0.9.9 (git revision 2633f; last commit 2016-07-17)

brew install neovim/neovim/neovim でエラー

homebrew-neovim/README.md at master · neovim/homebrew-neovim を参考にHomebrewからNeoVimをインストールしようとすると、 /usr/local/Library/ENV/4.3/sed: No such file or directory が出てコンパイルに失敗する。

sfmba13:~ fujisaki$ brew install neovim/neovim/neovim
==> Installing neovim from neovim/neovim
==> Downloading https://github.com/neovim/neovim/archive/v0.1.4.tar.gz
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim-0.1.4.tar.gz
==> Downloading https://github.com/libuv/libuv/archive/v1.8.0.tar.gz
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim--libuv-1.8.0.tar.gz
==> Downloading https://github.com/msgpack/msgpack-c/archive/cpp-1.0.0.tar.gz
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim--msgpack-1.0.0.tar.gz
==> Downloading https://raw.githubusercontent.com/neovim/deps/master/opt/LuaJIT-2.0.4.tar.gz
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim--luajit-2.0.4.tar.gz
==> Downloading https://github.com/keplerproject/luarocks/archive/5d8a16526573b36d5b22aa7486612
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim--luarocks-998466697.tar.gz
==> Downloading https://github.com/mauke/unibilium/archive/v1.2.0.tar.gz
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim--unibilium-1.2.0.tar.gz
==> Downloading http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.18.tar.gz
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim--libtermkey-0.18.tar.gz
==> Downloading https://github.com/neovim/libvterm/archive/1b745d29d45623aa8d22a7b9288c7b0e331c
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim--libvterm-7088.tar.gz
==> Downloading https://github.com/jemalloc/jemalloc/releases/download/4.0.2/jemalloc-4.0.2.tar
Already downloaded: /Users/fujisaki/Library/Caches/Homebrew/neovim--jemalloc-4.0.2.tar.bz2
==> Building third-party dependencies.
==> cmake ../third-party -DUSE_BUNDLED_BUSTED=OFF -DUSE_BUNDLED_LUV=OFF -DUSE_EXISTING_SRC_DIR=
==> make VERBOSE=1
Last 15 lines from /Users/fujisaki/Library/Logs/Homebrew/neovim/02.make:
/usr/local/Cellar/cmake/3.5.2/bin/cmake -E touch /tmp/neovim-20160717-18509-l1153s/neovim-0.1.4/deps-build/build/src/unibilium-stamp/unibilium-update
[ 19%] No configure step for 'unibilium'
cd /tmp/neovim-20160717-18509-l1153s/neovim-0.1.4/deps-build/build/src/unibilium && /usr/local/Cellar/cmake/3.5.2/bin/cmake -E echo_append
cd /tmp/neovim-20160717-18509-l1153s/neovim-0.1.4/deps-build/build/src/unibilium && /usr/local/Cellar/cmake/3.5.2/bin/cmake -E touch /tmp/neovim-20160717-18509-l1153s/neovim-0.1.4/deps-build/build/src/unibilium-stamp/unibilium-configure
[ 21%] Performing build step for 'unibilium'
cd /tmp/neovim-20160717-18509-l1153s/neovim-0.1.4/deps-build/build/src/unibilium && /Applications/Xcode.app/Contents/Developer/usr/bin/make CC=/usr/local/Library/Homebrew/shims/super/clang PREFIX=/tmp/neovim-20160717-18509-l1153s/neovim-0.1.4/deps-build/usr CFLAGS=-fPIC
glibtool --mode=compile --tag=CC /usr/local/Library/Homebrew/shims/super/clang -I. -Wall -std=c99 -fPIC  -o unibilium.lo -c unibilium.c
/usr/local/opt/libtool/bin/glibtool: line 923: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/opt/libtool/bin/glibtool: line 1378: /usr/local/Library/ENV/4.3/sed: No such file or directory
/usr/local/opt/libtool/bin/glibtool: line 1274: /usr/local/Library/ENV/4.3/sed: No such file or directory
:   error: Failed to create '.libs'
make[3]: *** [unibilium.lo] Error 1
make[2]: *** [build/src/unibilium-stamp/unibilium-build] Error 2
make[1]: *** [CMakeFiles/unibilium.dir/all] Error 2
make: *** [all] Error 2

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/neovim/homebrew-neovim/issues

These open issues may also help:
Neovim Fails to Install on Standalone Linuxbrew: libmsgpack.so Error https://github.com/neovim/homebrew-neovim/issues/156
 Neovim failing to build with homebrew on OS X 10.9.5  https://github.com/neovim/homebrew-neovim/issues/153
Can't install via homebrew-neovim if luarocks path is set explicitly https://github.com/neovim/homebrew-neovim/issues/149
Error when trying to install neovim in my Ubuntu 14.04 virtual machine. https://github.com/neovim/homebrew-neovim/issues/134

libtoolを再インストールする

GitHubのneovim/homebrew-neovimリポジトリに、類似のissueがあった。

neovim 0.1.4 fails on OSX 10.11.5 due to glibtool (SOLVED) · Issue #166 · neovim/homebrew-neovim

読むと、次のissueと似ているから試せと書いてある。

Fails to install on RHEL7 via Linuxbrew (SOLVED: brew reinstall -s libtool) · Issue #164 · neovim/homebrew-neovim

issueコメント通りに libtool をHomebrewで再インストールすることで、NeoVimのインストールが成功するようになった!

Google検索よりもGitHubリポジトリでissue検索

エラーをGoogleで検索すると、

fontforge fails to install, because glibtoolize doesn't respect Homebrew's Library location · Issue #43874 · Homebrew/legacy-homebrew

などが引っかかる。同じ libtool のエラーなのだけど、修正方法はneovim/homebrew-neovimリポジトリのissueに登録してあったものが一番スマートだった。

エラーが出た場合はGoogleで検索するよりも、リポジトリのissue検索が有効。