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

Homebrewで古いバージョンのdylibにswitchする

More than 1 year has passed since last update.

mpvを使おうとすると

dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
  Referenced from: /usr/local/bin/mpv
  Reason: image not found
Trace/BPT trap: 5

/usr/local/opt/jpeg/libを見ると

バージョンが上がっている

drwxr-xr-x 5 yukpiz admin    170 10 24 11:19 .
drwxr-xr-x 9 yukpiz admin    306 10 23 11:17 ..
-r--r--r-- 1 yukpiz admin 207280 10 23 11:17 libjpeg.9.dylib
-r--r--r-- 1 yukpiz admin 276744  1 17  2016 libjpeg.a
lrwxr-xr-x 1 yukpiz admin     15  1 17  2016 libjpeg.dylib -> libjpeg.9.dylib

古いバージョンが手元に残っているか調べる

8dが残っている

$ brew info libjpeg
jpeg: stable 9b (bottled)
Image manipulation library
http://www.ijg.org
/usr/local/Cellar/jpeg/8d (19 files, 713.8KB)
  Poured from bottle on 2016-12-16 at 19:52:28
/usr/local/Cellar/jpeg/9b (20 files, 725.2KB) *
  Poured from bottle on 2017-10-23 at 11:17:58
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/jpeg.rb

8dに切り替える

$ brew switch libjpeg 8d
Cleaning /usr/local/Cellar/jpeg/8d
Cleaning /usr/local/Cellar/jpeg/9b
17 links created for /usr/local/Cellar/jpeg/8d

9bにも戻せます

$ brew switch libjpeg 9b
Cleaning /usr/local/Cellar/jpeg/8d
Cleaning /usr/local/Cellar/jpeg/9b
17 links created for /usr/local/Cellar/jpeg/9b

参考

https://qiita.com/honeniq/items/778cc08d2db78e6774d8

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
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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