LoginSignup
8
4

More than 5 years have passed since last update.

SierraにRMagickを入れる

Posted at

RMagickを入れるのに何度やっても毎回困っているのでメモ。

古いバージョンのimagemagickのインストール

普通にbrew install imagemagickでインストールされるversionには対応していないため、古いversionのimagemagickをインストールする必要がある。

以下のリンクのように、homebrewのリポジトリから古いものをcheckoutすれば良さそう
http://qiita.com/satosystems/items/8587527b185a91abfb37

だが、手元で見ると何故か古いログを取得できず断念(これなんでか分かる人教えて欲しい)

なので、githubから直接ファイルを持ってくる
https://github.com/Homebrew/homebrew-core/blob/f6b47796d0fc3a05cc00d62fc68556b77ad5a1dc/Library/Formula/imagemagick.rb

これを/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/imagemagick.rb に上書きする

$ curl https://raw.githubusercontent.com/Homebrew/homebrew-core/f6b47796d0fc3a05cc00d62fc68556b77ad5a1dc/Library/Formula/imagemagick.rb >! /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/imagemagick.rb
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4096  100  4096    0     0  25149      0 --:--:-- --:--:-- --:--:-- 25283

すると欲しいversionのimagemagickがインストールできる

$ brew install imagemagick
==> Installing dependencies for imagemagick: pkg-config
==> Installing imagemagick dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.1_2.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.29.1_2.sierra.bottle.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.29.1_2: 10 files, 627.5K
==> Installing imagemagick
==> Using the sandbox
==> Downloading http://www.imagemagick.org/download/releases/ImageMagick-6.9.0-10.tar.xz
######################################################################## 100.0%
==> ./configure --disable-osx-universal-binary --prefix=/usr/local/Cellar/imagemagick/6.9.0-10 --enable-shared --disable-static --with-modules --disable-openmp --without-gslib --without-perl --with-gs-font-dir=/usr/local/share/ghostscript/fonts --without-pango --without-o
==> make install
🍺  /usr/local/Cellar/imagemagick/6.9.0-10: 1,450 files, 17.6M, built in 2 minutes 18 seconds

これで必要なimagemagickはインストールできたので、RMagickもインストールできる

$ gem install rmagick
Building native extensions.  This could take a while...
Successfully installed rmagick-2.16.0
Parsing documentation for rmagick-2.16.0
Installing ri documentation for rmagick-2.16.0
Done installing documentation for rmagick after 5 seconds
1 gem installed
8
4
0

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