ポートフォリオに画像アップロード機能を追加したく
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
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。