メモ。

ただのメモです。

dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylibによりbrew upgrade出来ない。

環境

f:id:b7craft:20170812084011p:plain

brew upgradeを実行すると、libjpeg.8.dylibがloadされてないってメッセージが出る。

$ brew update && brew upgrade
Already up-to-date.
==> Upgrading 5 outdated packages, with result:
homebrew/php/composer 1.5.1, hdf5 1.10.1_2, imagemagick 7.0.6-6, octave 4.2.1_4, homebrew/php/php70 7.0.22_14
dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
  Referenced from: /usr/local/opt/php70/bin/php
  Reason: image not found
composer: PHP Phar support is required for this formula
Error: An unsatisfied requirement failed this build.

libjpeg.8.dylibを探す。

$ sudo find / -name libjpeg.8.dylib
Password:
/usr/local/Cellar/jpeg/8d/lib/libjpeg.8.dylib

シンボリックリンクを貼る。

$ ln -s /usr/local/Cellar/jpeg/8d/lib/libjpeg.8.dylib /usr/local/opt/jpeg/lib/
$ ll /usr/local/opt/jpeg/lib/libjpeg.8.dylib 
lrwxr-xr-x  1 User  admin  45  8 12 08:24 /usr/local/opt/jpeg/lib/libjpeg.8.dylib -> /usr/local/Cellar/jpeg/8d/lib/libjpeg.8.dylib

$ brew update && brew upgradeを実行する。

Already up-to-date.
==> Upgrading 5 outdated packages, with result:
homebrew/php/composer 1.5.1, hdf5 1.10.1_2, imagemagick 7.0.6-6, octave 4.2.1_4, homebrew/php/php70 7.0.22_14
==> Upgrading homebrew/php/composer 
==> Downloading https://homebrew.bintray.com/bottles-php/composer-1.5.1.sierra.b
######################################################################## 100.0%
==> Pouring composer-1.5.1.sierra.bottle.1.tar.gz
==> Caveats
      composer no longer depends on the homebrew php Formulas since the last couple of macOS releases
      contains a php version compatible with composer. If this has been part of your workflow
      previously then please make the appropriate changes and `brew install php71` or other appropriate
      Homebrew PHP version.
==> Summary
🍺  /usr/local/Cellar/composer/1.5.1: 5 files, 1.8MB
==> Upgrading hdf5 
==> Downloading https://homebrew.bintray.com/bottles/hdf5-1.10.1_2.sierra.bottle
######################################################################## 100.0%
==> Pouring hdf5-1.10.1_2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/hdf5/1.10.1_2: 265 files, 14.6MB
==> Upgrading imagemagick 
==> Downloading https://homebrew.bintray.com/bottles/imagemagick-7.0.6-6.sierra.
######################################################################## 100.0%
==> Pouring imagemagick-7.0.6-6.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/imagemagick/7.0.6-6: 1,522 files, 22.7MB
==> Upgrading octave 
==> Installing dependencies for octave: flac, libogg, libvorbis, libsndfile, portaudio
==> Installing octave dependency: flac
==> Downloading https://homebrew.bintray.com/bottles/flac-1.3.2.sierra.bottle.ta
######################################################################## 100.0%
==> Pouring flac-1.3.2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/flac/1.3.2: 53 files, 1.8MB
==> Installing octave dependency: libogg
==> Downloading https://homebrew.bintray.com/bottles/libogg-1.3.2.sierra.bottle.
######################################################################## 100.0%
==> Pouring libogg-1.3.2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libogg/1.3.2: 96 files, 457.5KB
==> Installing octave dependency: libvorbis
==> Downloading https://homebrew.bintray.com/bottles/libvorbis-1.3.5_1.sierra.bo
######################################################################## 100.0%
==> Pouring libvorbis-1.3.5_1.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libvorbis/1.3.5_1: 159 files, 2.3MB
==> Installing octave dependency: libsndfile
==> Downloading https://homebrew.bintray.com/bottles/libsndfile-1.0.28.sierra.bo
######################################################################## 100.0%
==> Pouring libsndfile-1.0.28.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/libsndfile/1.0.28: 48 files, 1.8MB
==> Installing octave dependency: portaudio
==> Downloading https://homebrew.bintray.com/bottles/portaudio-19.6.0.sierra.bot
######################################################################## 100.0%
==> Pouring portaudio-19.6.0.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/portaudio/19.6.0: 33 files, 452.7KB
==> Installing octave
==> Downloading https://homebrew.bintray.com/bottles/octave-4.2.1_4.sierra.bottl
######################################################################## 100.0%
==> Pouring octave-4.2.1_4.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/octave/4.2.1_4: 2,182 files, 37.4MB
==> Upgrading homebrew/php/php70 
==> Downloading https://homebrew.bintray.com/bottles-php/php70-7.0.22_14.sierra.
######################################################################## 100.0%
==> Pouring php70-7.0.22_14.sierra.bottle.tar.gz
==> Caveats

The php.ini file can be found in:
    /usr/local/etc/php/7.0/php.ini

✩✩✩✩ Extensions ✩✩✩✩

If you are having issues with custom extension compiling, ensure that you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:

      PATH="/usr/local/bin:$PATH"

PHP70 Extensions will always be compiled against this PHP. Please install them using --without-homebrew-php to enable compiling against system PHP.

✩✩✩✩ PHP CLI ✩✩✩✩

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, ~/.zshrc, ~/.profile or your shell's equivalent configuration file:
  export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"

✩✩✩✩ FPM ✩✩✩✩

To launch php-fpm on startup:
    mkdir -p ~/Library/LaunchAgents
    cp /usr/local/opt/php70/homebrew.mxcl.php70.plist ~/Library/LaunchAgents/
    launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.php70.plist

The control script is located at /usr/local/opt/php70/sbin/php70-fpm

OS X 10.8 and newer come with php-fpm pre-installed, to ensure you are using the brew version you need to make sure /usr/local/sbin is before /usr/sbin in your PATH:

  PATH="/usr/local/sbin:$PATH"

You may also need to edit the plist to use the correct "UserName".

Please note that the plist was called 'homebrew-php.josegonzalez.php70.plist' in old versions of this formula.

With the release of macOS Sierra the Apache module is now not built by default. If you want to build it on your system you have to install php with the --with-httpd24 option. See  brew options php70 for more details.

To have launchd start homebrew/php/php70 now and restart at login:
  brew services start homebrew/php/php70
==> Summary
🍺  /usr/local/Cellar/php70/7.0.22_14: 337 files, 38.6MB

出来た。


参考