LoginSignup
24
9

More than 5 years have passed since last update.

vimが「dyld: Library not loaded」エラーが出て起動できない(MacOS High Sierra)

Posted at

最近、家でコード書いてなかったんで気がつかなかったんですが、今日vim使って簡単なサンプルコード書こうと思ったら

$ vi hoge.php
dyld: Library not loaded: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib
  Referenced from: /usr/local/bin/vim
  Reason: image not found
Abort trap: 6

起動すらできん。
そんなの見つからねーよ、って怒られてますね

$ ls -al /System/Library/Frameworks/Ruby.framework/Versions/
total 0
drwxr-xr-x  4 root  wheel  128  1 21 14:59 .
drwxr-xr-x  5 root  wheel  160  1 21 14:59 ..
drwxr-xr-x  6 root  wheel  192 12  2 04:40 2.3
lrwxr-xr-x  1 root  wheel    3  1 21 14:53 Current -> 2.3

2.0じゃなくなってますね。そりゃダメだw
最近、High Sierraに上げたからかな?
まぁいい。とりあえずvimが動かないと、ちょっとサンプルコード書くだけでIDEとかだるい。(Atomも入ってるけどvimが好きなんだよ)
ググってみると同じ状況になった人が結構いたみたい。brewで入れたんなら、brew upgradeすりゃいいぜ?ってことだったので

$ brew upgrade vim

してみる。が・・・

Updating Homebrew...
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing: git config --local --replace-all homebrew.analyticsmessage true
Error: Your Xcode (8.0) is too outdated.
Please update to Xcode 9.2 (or delete it).
Xcode can be updated from the App Store.

そんなパスねーよ、お前のXcode古すぎだよ。Xcode9.2以上にしろよ(意訳)と言われているので、仕方ない。
ElCapitan時代に入れたのになかったことになってるのか、App Storeのアップデートには出ないので、検索してインストール。
あいかわらず、ダウンロード時間かかりすぎ。

気を取り直して、もう一回。

$ brew upgrade vim
Updating Homebrew...
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics.html
・・・略・・・
==> Installing vim dependency: perl
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Error: Failure while executing: git config --local --replace-all homebrew.private true

え、アプデしろっていうからしたのに、この仕打ちw
確かにこのパスにそんなんいないけど、Xcode入れろって言ったじゃんねー
コマンドラインツールか・・・
というわけで、Appleからダウンロードしてから、気を取り直してもう一度。

$ brew upgrade vim
==> Upgrading 1 outdated package, with result:
vim 8.0.1450
==> Upgrading vim --with-lua
・・・略・・・
==> Pouring python-2.7.14_2.high_sierra.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks

進んだのも束の間。パーミッションないわい。
この他にもパーミッションがないって怒られている。いや、これ、なんか違う気がする・・・

$ brew update
Already up-to-date.

ふむ。新しいと。

$ brew upgrade
==> Upgrading 2 outdated packages, with result:
vim 8.0.1450, lua 5.3.4_2
==> Upgrading vim --with-lua
==> Installing dependencies for vim: lua
・・・略・・・
==> make
==> make install prefix=/usr/local/Cellar/vim/8.0.1450 STRIP=/usr/bin/true
🍺  /usr/local/Cellar/vim/8.0.1450: 1,427 files, 22.9MB, built in 1 minute 14 seconds

というわけで、vimも無事、使えるようになりましたとさ。
vimだけ指定してupgradeできないときは、他にもhomebrew経由で入ったものが古いとかもあるので、一度brew upgradeしてみるといいかもしれません。

24
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
9