MacでHomebrewを使わずImagemagickをインストールする方法とpath_helperについて
Mac OS X 10.9.3. 最初 gs, imagemagickをHomebrewで入れてconvertを使おうとしたのだが,
convert: no images defined `output.png' @ error/convert.c/ConvertImageCommand/3210.
とかエラーが出ていろいろ苦労していた. そこで
$ brew remove imagemagick
で消した後, 以下のページから.pkg
を落として入れることで無事使えるようになった.
ImageMagick installer for Mac OS X
pkgで入れるのちょっと嫌だったんだが, 結果は/opt/ImageMagick/
, /opt/Ghostscript/
に入るようで興味を持つ. 説明に/etc/paths.d/
がどうこう書いてて, shell開き直すと確かにPATHに反映されてる.
$ cat /etc/paths.d/ImageMagick
/opt/ImageMagick/bin
$ which convert
/opt/ImageMagick/bin/convert
初耳だったので調べてみたところ /etc/paths
はBSD由来の何かっぽい. /etc/profile
中で/usr/libexec/path_helper
が呼び出されている.
# ...
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
# ...
man path_helper
すると,
path_helper(8) BSD System Manager's Manual path_helper(8)
NAME
path_helper -- helper for constructing PATH environment variableSYNOPSIS
path_helper [-c | -s]DESCRIPTION
The path_helper utility reads the contents of the files in the directories /etc/paths.d and /etc/manpaths.d and appends their contents to the PATH and MANPATH environ-
ment variables respectively. (The MANPATH environment variable will not be modified unless it is already set in the environment.)
とのことで, 単に/etc/paths
らへんの設定テキストを元にPATH=...
をセットしてexportするだけのシロモノらしい
$ /usr/libexec/path_helper -s
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/Ghostscript/bin:/opt/ImageMagick/bin:/usr/texbin:...:/Users/hash/.go/bin"; export PATH;
なるほど.
Author And Source
この問題について(MacでHomebrewを使わずImagemagickをインストールする方法とpath_helperについて), 我々は、より多くの情報をここで見つけました https://qiita.com/hash/items/3bd40f6308bb84134246著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .