railsアプリに画像アップロード機能を付けたのですが、スマートデバイスからアップロードした画像が90度回転してしまう現象が起きています。
exif情報を操作してこの問題を解消したいと思い、rmagickのgemを導入しようとしているのですが、インストールができません。
gem "rmagick"
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/rmagick-4.1.0/ext/RMagick /home/user/.rbenv/versions/2.6.5/bin/ruby -I /home/user/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200328-29183-ms5zol.rb extconf.rb checking for brew... no checking for pacman... no checking for Ruby version >= 2.3.0... yes checking for pkg-config... 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 Package 'MagickCore', required by 'virtual:world', not found ERROR: Can't install RMagick 4.1.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=/home/user/.rbenv/versions/2.6.5/bin/$(RUBY_BASE_NAME) To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/rmagick-4.1.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/rmagick-4.1.0 for inspection. Results logged to /home/user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/rmagick-4.1.0/gem_make.out An error occurred while installing rmagick (4.1.0), and Bundler cannot continue. Make sure that `gem install rmagick -v '4.1.0' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rmagick
上記のエラーが出たので、「gem install rmagick -v '4.1.0' --source 'https://rubygems.org/'」を実行すると、
Building native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. current directory: /home/user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/rmagick-4.1.0/ext/RMagick /home/user/.rbenv/versions/2.6.5/bin/ruby -I /home/user/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200328-29244-1kajxcf.rb extconf.rb checking for brew... no checking for pacman... no checking for Ruby version >= 2.3.0... yes checking for pkg-config... 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 Package 'MagickCore', required by 'virtual:world', not found ERROR: Can't install RMagick 4.1.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=/home/user/.rbenv/versions/2.6.5/bin/$(RUBY_BASE_NAME) To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/rmagick-4.1.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/rmagick-4.1.0 for inspection. Results logged to /home/user/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/rmagick-4.1.0/gem_make.out
とエラーが出ました。
対処法を教えてください。
また、centosでパッケージが必要かと思いますが、centos8のパッケージ(dnf)が見つかりません。
そのあたりもご存じであればご教授ください。
####バージョン
rails 6.0.2.1
ruby 2.6.5
CentOS 8
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。