質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

2474閲覧

RMagickがインストール出来ない

ko-u

総合スコア61

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2018/12/12 05:24

ポートフォリオに画像アップロード機能を追加したく
RMagickをインストールしようとした際にエラーが出てしまいました。

長く解決することが出来ていないので、ご教授頂ければ幸いです。

【エラー内容】

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/onoderakoudai/Desktop/Sentou/vendor/bundle/ruby/2.5.0/gems/rmagick-2.16.0/ext/RMagick /Users/onoderakoudai/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20181212-59454-2mils2.rb extconf.rb checking for clang... yes checking for Magick-config... yes checking for outdated ImageMagick version (<= 6.4.9)... no checking for presence of MagickWand API (ImageMagick version >= 6.9.0)... no Package MagickWand was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickWand.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickWand' found Package MagickWand was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickWand.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickWand' found Package MagickWand was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickWand.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickWand' found Package MagickWand was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickWand.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickWand' found checking for Ruby version >= 1.8.5... yes Package MagickCore was not found in the pkg-config search path. Perhaps you should add the directory containing `MagickCore.pc' to the PKG_CONFIG_PATH environment variable No package 'MagickCore' found Can't install RMagick 2.16.0. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information. *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/onoderakoudai/.rbenv/versions/2.5.1/bin/$(RUBY_BASE_NAME) To see why this extension failed to compile, please check the mkmf.log which can be found here: /Users/onoderakoudai/Desktop/Sentou/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/rmagick-2.16.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /Users/onoderakoudai/Desktop/Sentou/vendor/bundle/ruby/2.5.0/gems/rmagick-2.16.0 for inspection. Results logged to /Users/onoderakoudai/Desktop/Sentou/vendor/bundle/ruby/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/rmagick-2.16.0/gem_make.out An error occurred while installing rmagick (2.16.0), and Bundler cannot continue. Make sure that `gem install rmagick -v '2.16.0' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rmagick

【実行したこと】

brew uninstall imagemagic

でアンインストールをするも、brew install imagemagick@6でエラー。

そこで、

blow doctor

を実行したところ

Warning: Broken symlinks were found. Remove them with `brew prune`: /usr/local/bin/code

と表示されたので、

brew prune /usr/local/bin/code

を実行しシンボリックを削除しました。

そのお陰か、brew install imagemagick@6が成功しました。

しかし、Gemgileにgem 'rmagick'を記載し、bundle installをすると

上記のエラーが表示されてしまいます。。。

brew info imagemagick

を実行し、バージョンを確認したところ、

imagemagick: stable 7.0.8-16 (bottled), HEAD

と表示され、なぜか7系のようです。
しかし、

/usr/local/Cellar

を確認してみると、imagemagick@6しかありません。。。

【参考記事】
https://qiita.com/fumi_042/items/55be8fb37cc23325b7c2
https://qiita.com/unsoluble_sugar/items/acaffa6d0e28c3c24934
https://qiita.com/sho012b/items/362abe993248c686fcf4
https://qiita.com/niwasawa/items/1144f20a9f2de4b76977

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

7系は存在してませんでしたが、brew link --force imagemagick@6を実行することで解決することが出来ました!

投稿2018/12/12 23:57

ko-u

総合スコア61

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問