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

dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib - homebrew php

More than 1 year has passed since last update.

dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib - homebrew php

最近ずっと仮想環境での作業なので、homebrewのphpとか久し振りに触るとぶっ壊れてることおおいですね。

brew updateとbrew upgradeやってたらlibjpeg見つからないって言われたので、

$ php -v
dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
Trace/BPT trap: 5

こちらを参考に、解決しました。
homebrewで過去のバージョンインストールする方法

でも!コメント頂きまして、
これでかいけつできるみたいでしゅ…!

brew switch jpeg 8d

上記で解決できなかった場合を除いて、以下無駄です…!

libjpegのバージョン違いだったので、v8のjpegのライブラリがはいってるコミットを探します。

Formulaが置いてあるディレクトリで

cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/

ログ検索

brew log jpeg

最新のだと、これくらいしかログが出ないので、

Warning: homebrew/core is a shallow clone so only partial output will be shown.
To get a full clone run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow
commit 2cfb629ee82e4e3bced64d14669192b281b14055
Author: BrewTestBot <brew-test-bot@googlegroups.com>
Date:   Mon Aug 7 06:33:22 2017 +0000

    jpeg: update 9b bottle.

commit 1fee4a326dd7144e192027705fa82d86e4676837
Author: ilovezfs <ilovezfs@icloud.com>
Date:   Sat Aug 5 11:44:29 2017 -0700

    jpeg 9b

commit b23146936a3abb57aabb39017561e7b0c750abbf
Author: FX Coudert <fxcoudert@gmail.com>
Date:   Sun Mar 12 09:15:30 2017 +0100

    jpeg: drop universal

commit 8a07d55e33686dda515024cc69fe5c862ff30ad0
Author: BrewTestBot <brew-test-bot@googlegroups.com>
Date:   Fri Dec 2 12:16:30 2016 +0000

    libical-glib: update 1.0.4_1 bottle.

古いのもfetchします。

git -C "$(brew --repo homebrew/core)" fetch --unshallow

そしてもう一回、logをみると

brew log jpeg

対象のログが見つかりました。

commit 7f16e5aa9451ea391cbb7822a59d2bf702c5b834
Author: BrewTestBot <brew-test-bot@googlegroups.com>
Date:   Tue Sep 6 14:22:41 2016 +0100

    jpeg: update 8d bottle.

これをチェックアウトして、

git checkout 7f16e5aa9451ea391cbb7822a59d2bf702c5b834 jpeg.rb

jpegをインストール

brew install jpeg

すると、うごきました。

php -v
PHP 7.1.7 (cli) (built: Jul 19 2017 15:58:29) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

忘れそうなので、masterに一応戻しときましょう。

git checkout master
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
No 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
ユーザーは見つかりませんでした