rmagickの導入に失敗してしまいます。。。
Amazon AWS版のcloud9でruby on railsを用いたWebアプリケーション開発の練習をしており、当該アプリケーションにrmagickを導入しようとしましたが、エラーが出て先に進めません。。。色々調べたのですが、自力で解決できず、みなさまにご助力いただけると幸いです。
発生している問題・エラーメッセージ
gemファイルにrmagickを含めてbundle installすると下記エラーが表示されます。
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/rmagick-3.1.0/ext/RMagick /home/ec2-user/.rvm/rubies/ruby-2.6.0/bin/ruby -I /home/ec2-user/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0 -r ./siteconf20190519-5280-16za39s.rb extconf.rb checking for brew... no checking for gcc... yes checking for pkg-config... yes ERROR: Can't install RMagick 3.1.0. Can't find ImageMagick with pkg-config *** 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=/home/ec2-user/.rvm/rubies/ruby-2.6.0/bin/$(RUBY_BASE_NAME) To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/ec2-user/.rvm/gems/ruby-2.6.0/extensions/x86_64-linux/2.6.0/rmagick-3.1.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/rmagick-3.1.0 for inspection. Results logged to /home/ec2-user/.rvm/gems/ruby-2.6.0/extensions/x86_64-linux/2.6.0/rmagick-3.1.0/gem_make.out An error occurred while installing rmagick (3.1.0), and Bundler cannot continue. Make sure that `gem install rmagick -v '3.1.0' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rmagick
ちなみに、ImageMagickのバージョンを調べると下記の通り表示されます。
Version: ImageMagick 6.7.8-9 2016-06-22 Q16 http://www.imagemagick.org
試したこと
試したこと①:pkg-configのインストール
$ sudo yum install pkg-config
下記エラーが出てしまい解決に繋がりませんでした。
Loaded plugins: priorities, update-motd, upgrade-helper amzn-main | 2.1 kB 00:00:00 amzn-updates | 2.5 kB 00:00:00 1062 packages excluded due to repository priority protections No package pkg-config available. Error: Nothing to do
よろしくお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。