N=1

主にコンピュータ技術関連のことを投稿。 / 投稿は個人の意見であり所属団体の立場を代表するものではありません。

homebrewでImageMagickのインストールに失敗する

ImageMagickをインストールしようとした。しかし依存先のlibtiffのダウンロードに失敗する。

$ sudo brew install ImageMagick
==> Downloading ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.5.zip

curl: (7) couldn't connect to host
Error: Failure while executing: /usr/bin/curl -f#LA Homebrew\ 0.8\ (Ruby\ 1.8.7-249;\ Mac\ OS\ X\ 10.7.1) ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.5.zip -o /Users/ishn/Library/Caches/Homebrew/libtiff-3.9.5.zip


brew edit packageでインストール情報を書き換えられるらしい。urlのところを編集。

require 'formula'

class Libtiff < Formula
  homepage 'http://www.remotesensing.org/libtiff/'
  url 'http://download2.osgeo.org/libtiff/tiff-3.9.5.zip'
  sha256 '332d1a658340c41791fce62fb8fff2a5ba04c2e82b8b85e741eb0a7b30e0d127'

  def install
    system "./configure", "--prefix=#{prefix}", "--mandir=#{man}"
    system "make install"
  end
end

そして再試行

$ sudo brew install ImageMagick
中略
==> Cloning https://github.com/adamv/ImageMagick.git
Cloning into /Library/Caches/Homebrew/imagemagick--git...
fatal: https://github.com/adamv/ImageMagick.git/info/refs not found: did you run git update-server-info on the server?
Error: Failure while executing: git clone --depth 1 https://github.com/adamv/ImageMagick.git /Library/Caches/Homebrew/imagemagick--git

うまくいかない。brewのメンテナはなにをやっているのだ。
以下を参考に、
ImageMagick install fails: git "info/refs not found: did you run git update-server-info on the server" · Issue #6994 · mxcl/homebrew · GitHub
$ cd `brew --prefix`
$ git reset --hard FETCH_HEAD
HEAD is now at c986689 gulags 1.6

これで再試行したら通った。