RMagick4.1.2 An error occurred during installation. I want to get rid of the error and install it.
ImageMagick was 6.9.10, so I upgraded it to 7.0.10 and it was installed.
# gem install rmagick -v '4.1.2'
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /usr/local/bundle/gems/rmagick-4.1.2/ext/RMagick
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.6.0 -r ./siteconf20201029-30239-189vtpy.rb extconf.rb
checking for brew... no
checking for pacman... no
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... no
ERROR: Can't install RMagick 4.1.2. Can't find pkg-config in /usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
There was an error here. The following is version information.
# ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
# apt list
imagemagick-6-common/stable,stable,now 8:6.9.10.23+dfsg-2.1+deb10u1 all [installed,automatic]
imagemagick-6-doc/stable,stable 8:6.9.10.23+dfsg-2.1+deb10u1 all
imagemagick-6.q16/stable,stable,now 8:6.9.10.23+dfsg-2.1+deb10u1 amd64 [installed,automatic]
imagemagick-6.q16hdri/stable,stable 8:6.9.10.23+dfsg-2.1+deb10u1 amd64
imagemagick-common/stable,stable 8:6.9.10.23+dfsg-2.1+deb10u1 all
imagemagick-doc/stable,stable 8:6.9.10.23+dfsg-2.1+deb10u1 all
imagemagick/stable,stable,now 8:6.9.10.23+dfsg-2.1+deb10u1 amd64 [installed]
# apt remove imagemagick
# sudo apt update
# sudo apt-get install build-essential
# wget https://www.imagemagick.org/download/ImageMagick.tar.gz
# tar xvzf ImageMagick.tar.gz
# cd ImageMagick-7.0.10-34/
# ./configure
# make
# make install
#Runtime link settings
# ldconfig /usr/local/lib
#Confirmation
# magick -version
Version: ImageMagick 7.0.10-34 Q16 x86_64 2020-10-29 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(4.5)
Delegates (built-in): bzlib djvu fontconfig freetype jbig jng jp2 jpeg lcms lqr lzma openexr png tiff x xml zlib
# gem install rmagick -v '4.1.2'
Building native extensions. This could take a while...
Successfully installed rmagick-4.1.2
1 gem installed
You did it.