LoginSignup
10
4

More than 5 years have passed since last update.

gs_init.psが見つからない時の対応方法メモ

Last updated at Posted at 2016-09-03

久しぶりにTeXを使ってモノを書かなければならなかった。dvipdfmxを使ったらコンパイルが通らなかった(前は同じ端末で動いてたのになぜ?)ので対応方法をメモ。

環境

Mac OSX Yosemite 10.10.5

エラー内容

エラーメッセージとしてはこんな感じ。dviからpdfに変換できない。

$ dvipdfmx paper.dvi
...
... GPL Ghostscript 9.16: Can't find initialization file gs_init.ps.

対応

Ghostscriptが何かアヤシイので確認。

$ gs -v
GPL Ghostscript 9.16 (2015-03-30)
Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.

インストールし直そうと思い、homebrewで入れてみる。9.19をインストール。

$ brew install ghostscript

まだなおらないし、gsコマンドのバージョンが変わってないぞ。。

$ dvipdfmx sample.dvi
...
... GPL Ghostscript 9.16: Can't find initialization file gs_init.ps.

$ gs -v
GPL Ghostscript 9.16 (2015-03-30)
Copyright (C) 2015 Artifex Software, Inc.  All rights reserved.

gsコマンドはシンボリックリンクで、それがhomebrewで入れたものに向いてないっぽい。

$ ls -al $(which gs)
... gs -> /usr/local/bin/gs-X11

リンクを張り替える。

$ rm /usr/local/bin/gs
$ ln -s /usr/local/Cellar/ghostscript/9.19/bin/gs /usr/local/bin/gs

gsのバージョンが変わる。

$ gs -v
GPL Ghostscript 9.19 (2016-03-23)
Copyright (C) 2016 Artifex Software, Inc.  All rights reserved.

動くようになる。

$ dvipdfmx paper.dvi
paper.dvi -> paper.pdf
[1][2][3][4][5][6][7][8][9][10] ... 
10
4
1

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
10
4