1. 程式人生 > >Gem install rmagick 報錯問題~

Gem install rmagick 報錯問題~

earch root bzip roo can which xtra sum dev

本人在CentOS7上在 執行”gem install rmagick“是報錯,具體情況如下:

報錯如下:

[[email protected] ~]# gem install rmagick -v ‘2.16.0‘
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

current directory: /usr/local/rvm/gems/ruby-2.3.3/gems/rmagick-2.16.0/ext/RMagick
/usr/local/rvm/rubies/ruby-2.3.3/bin/ruby -r ./siteconf20170824-27278-k6d800.rb extconf.rb
checking for gcc... yes
checking for Magick-config... no
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
No package ‘MagickCore‘ found
checking for outdated ImageMagick version (<= 6.4.9)... *** 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=/usr/local/rvm/rubies/ruby-2.3.3/bin/$(RUBY_BASE_NAME)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/usr/local/rvm/gems/ruby-2.3.3/extensions/x86_64-linux/2.3.0/rmagick-2.16.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.3.3/gems/rmagick-2.16.0 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.3.3/extensions/x86_64-linux/2.3.0/rmagick-2.16.0/gem_make.out

查找很多資料之後,發現 缺少” ImageMagick-devel“

執行 yum install ImageMagick-devel

[[email protected] ~]# yum install ImageMagick-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.sjtu.edu.cn
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: ftp.sjtu.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package ImageMagick-devel.x86_64 0:6.7.8.9-15.el7_2 will be installed
--> Processing Dependency: ImageMagick = 6.7.8.9-15.el7_2 for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libtiff-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libjpeg-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libXt-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libXext-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libX11-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: jasper-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: ghostscript-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: freetype-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: bzip2-devel for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libMagickWand.so.5()(64bit) for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libMagickCore.so.5()(64bit) for package: ImageMagick-devel-6.7.8.9-15.el7_2.x86_64
--> Running transaction check
---> Package ImageMagick.x86_64 0:6.7.8.9-15.el7_2 will be installed
--> Processing Dependency: libwmflite-0.2.so.7()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libImath.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libIlmThread.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libIlmImf.so.7()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libIexMath.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libIex.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
--> Processing Dependency: libHalf.so.6()(64bit) for package: ImageMagick-6.7.8.9-15.el7_2.x86_64
---> Package bzip2-devel.x86_64 0:1.0.6-13.el7 will be installed
---> Package freetype-devel.x86_64 0:2.4.11-12.el7 will be installed
---> Package ghostscript-devel.x86_64 0:9.07-20.el7_3.7 will be installed
--> Processing Dependency: ghostscript = 9.07-20.el7_3.7 for package: ghostscript-devel-9.07-20.el7_3.7.x86_64
---> Package jasper-devel.x86_64 0:1.900.1-30.el7_3 will be installed
--> Processing Dependency: jasper-libs(x86-64) = 1.900.1-30.el7_3 for package: jasper-devel-1.900.1-30.el7_3.x86_64
---> Package libX11-devel.x86_64 0:1.6.3-3.el7 will be installed
--> Processing Dependency: pkgconfig(xcb) >= 1.1.92 for package: libX11-devel-1.6.3-3.el7.x86_64
--> Processing Dependency: pkgconfig(xproto) for package: libX11-devel-1.6.3-3.el7.x86_64
--> Processing Dependency: pkgconfig(xcb) for package: libX11-devel-1.6.3-3.el7.x86_64
--> Processing Dependency: pkgconfig(kbproto) for package: libX11-devel-1.6.3-3.el7.x86_64
---> Package libXext-devel.x86_64 0:1.3.3-3.el7 will be installed
---> Package libXt-devel.x86_64 0:1.1.4-6.1.el7 will be installed
--> Processing Dependency: pkgconfig(sm) for package: libXt-devel-1.1.4-6.1.el7.x86_64
--> Processing Dependency: pkgconfig(ice) for package: libXt-devel-1.1.4-6.1.el7.x86_64
---> Package libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7 will be installed
---> Package libtiff-devel.x86_64 0:4.0.3-27.el7_3 will be installed
--> Processing Dependency: libtiff(x86-64) = 4.0.3-27.el7_3 for package: libtiff-devel-4.0.3-27.el7_3.x86_64
--> Running transaction check
---> Package OpenEXR-libs.x86_64 0:1.7.1-7.el7 will be installed
---> Package ghostscript.x86_64 0:9.07-20.el7 will be updated
--> Processing Dependency: ghostscript = 9.07-20.el7 for package: ghostscript-cups-9.07-20.el7.x86_64
---> Package ghostscript.x86_64 0:9.07-20.el7_3.7 will be an update
---> Package ilmbase.x86_64 0:1.0.3-7.el7 will be installed
---> Package jasper-libs.x86_64 0:1.900.1-29.el7 will be updated
---> Package jasper-libs.x86_64 0:1.900.1-30.el7_3 will be an update
---> Package libICE-devel.x86_64 0:1.0.9-2.el7 will be installed
---> Package libSM-devel.x86_64 0:1.2.2-2.el7 will be installed
---> Package libtiff.x86_64 0:4.0.3-25.el7_2 will be updated
---> Package libtiff.x86_64 0:4.0.3-27.el7_3 will be an update
---> Package libwmf-lite.x86_64 0:0.2.8.4-41.el7_1 will be installed
---> Package libxcb-devel.x86_64 0:1.11-4.el7 will be installed
--> Processing Dependency: pkgconfig(xau) >= 0.99.2 for package: libxcb-devel-1.11-4.el7.x86_64
---> Package xorg-x11-proto-devel.noarch 0:7.7-13.el7 will be installed
--> Running transaction check
---> Package ghostscript-cups.x86_64 0:9.07-20.el7 will be updated
---> Package ghostscript-cups.x86_64 0:9.07-20.el7_3.7 will be an update
---> Package libXau-devel.x86_64 0:1.0.8-2.1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================
Package Arch Version Repository Size
==============================================================================================
Installing:
ImageMagick-devel x86_64 6.7.8.9-15.el7_2 base 100 k
Installing for dependencies:
ImageMagick x86_64 6.7.8.9-15.el7_2 base 2.1 M
OpenEXR-libs x86_64 1.7.1-7.el7 base 217 k
bzip2-devel x86_64 1.0.6-13.el7 base 218 k
freetype-devel x86_64 2.4.11-12.el7 base 356 k
ghostscript-devel x86_64 9.07-20.el7_3.7 updates 51 k
ilmbase x86_64 1.0.3-7.el7 base 100 k
jasper-devel x86_64 1.900.1-30.el7_3 updates 376 k
libICE-devel x86_64 1.0.9-2.el7 base 49 k
libSM-devel x86_64 1.2.2-2.el7 base 13 k
libX11-devel x86_64 1.6.3-3.el7 base 980 k
libXau-devel x86_64 1.0.8-2.1.el7 base 14 k
libXext-devel x86_64 1.3.3-3.el7 base 75 k
libXt-devel x86_64 1.1.4-6.1.el7 base 445 k
libjpeg-turbo-devel x86_64 1.2.90-5.el7 base 98 k
libtiff-devel x86_64 4.0.3-27.el7_3 updates 473 k
libwmf-lite x86_64 0.2.8.4-41.el7_1 base 66 k
libxcb-devel x86_64 1.11-4.el7 base 1.1 M
xorg-x11-proto-devel noarch 7.7-13.el7 base 281 k
Updating for dependencies:
ghostscript x86_64 9.07-20.el7_3.7 updates 4.3 M
ghostscript-cups x86_64 9.07-20.el7_3.7 updates 56 k
jasper-libs x86_64 1.900.1-30.el7_3 updates 150 k
libtiff x86_64 4.0.3-27.el7_3 updates 170 k

Transaction Summary
==============================================================================================
Install 1 Package (+18 Dependent packages)
Upgrade ( 4 Dependent packages)

Total size: 12 M
Total download size: 7.0 M
Is this ok [y/d/N]: y
Downloading packages:
(1/19): OpenEXR-libs-1.7.1-7.el7.x86_64.rpm | 217 kB 00:00:11
(2/19): ghostscript-devel-9.07-20.el7_3.7.x86_64.rpm | 51 kB 00:00:01
(3/19): bzip2-devel-1.0.6-13.el7.x86_64.rpm | 218 kB 00:00:13
(4/19): ilmbase-1.0.3-7.el7.x86_64.rpm | 100 kB 00:00:01
(5/19): freetype-devel-2.4.11-12.el7.x86_64.rpm | 356 kB 00:00:13
(6/19): libSM-devel-1.2.2-2.el7.x86_64.rpm | 13 kB 00:00:00
(7/19): libICE-devel-1.0.9-2.el7.x86_64.rpm | 49 kB 00:00:00
(8/19): libXau-devel-1.0.8-2.1.el7.x86_64.rpm | 14 kB 00:00:00
(9/19): ImageMagick-devel-6.7.8.9-15.el7_2.x86_64.rpm | 100 kB 00:00:18
(10/19): libXext-devel-1.3.3-3.el7.x86_64.rpm | 75 kB 00:00:15
(11/19): jasper-devel-1.900.1-30.el7_3.x86_64.rpm | 376 kB 00:00:19
(12/19): libXt-devel-1.1.4-6.1.el7.x86_64.rpm | 445 kB 00:00:16
(13/19): libjpeg-turbo-devel-1.2.90-5.el7.x86_64.rpm | 98 kB 00:00:05
(14/19): libwmf-lite-0.2.8.4-41.el7_1.x86_64.rpm | 66 kB 00:00:11
(15/19): libX11-devel-1.6.3-3.el7.x86_64.rpm | 980 kB 00:00:33
(16/19): libtiff-devel-4.0.3-27.el7_3.x86_64.rpm | 473 kB 00:00:20
(17/19): libxcb-devel-1.11-4.el7.x86_64.rpm | 1.1 MB 00:00:20
(18/19): xorg-x11-proto-devel-7.7-13.el7.noarch.rpm | 281 kB 00:00:18
(19/19): ImageMagick-6.7.8.9-15.el7_2.x86_64.rpm | 2.1 MB 00:01:11
----------------------------------------------------------------------------------------------
Total 99 kB/s | 7.0 MB 00:01:12
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : xorg-x11-proto-devel-7.7-13.el7.noarch 1/27
Updating : libtiff-4.0.3-27.el7_3.x86_64 2/27
Updating : ghostscript-9.07-20.el7_3.7.x86_64 3/27
Installing : libICE-devel-1.0.9-2.el7.x86_64 4/27
Updating : jasper-libs-1.900.1-30.el7_3.x86_64 5/27
Installing : libjpeg-turbo-devel-1.2.90-5.el7.x86_64 6/27
Installing : ilmbase-1.0.3-7.el7.x86_64 7/27
Installing : OpenEXR-libs-1.7.1-7.el7.x86_64 8/27
Installing : jasper-devel-1.900.1-30.el7_3.x86_64 9/27
Installing : libSM-devel-1.2.2-2.el7.x86_64 10/27
Installing : ghostscript-devel-9.07-20.el7_3.7.x86_64 11/27
Installing : libtiff-devel-4.0.3-27.el7_3.x86_64 12/27
Installing : libXau-devel-1.0.8-2.1.el7.x86_64 13/27
Installing : libxcb-devel-1.11-4.el7.x86_64 14/27
Installing : libX11-devel-1.6.3-3.el7.x86_64 15/27
Installing : libXext-devel-1.3.3-3.el7.x86_64 16/27
Installing : libXt-devel-1.1.4-6.1.el7.x86_64 17/27
Installing : libwmf-lite-0.2.8.4-41.el7_1.x86_64 18/27
Installing : ImageMagick-6.7.8.9-15.el7_2.x86_64 19/27
Installing : bzip2-devel-1.0.6-13.el7.x86_64 20/27
Installing : freetype-devel-2.4.11-12.el7.x86_64 21/27
Installing : ImageMagick-devel-6.7.8.9-15.el7_2.x86_64 22/27
Updating : ghostscript-cups-9.07-20.el7_3.7.x86_64 23/27
Cleanup : ghostscript-cups-9.07-20.el7.x86_64 24/27
Cleanup : ghostscript-9.07-20.el7.x86_64 25/27
Cleanup : libtiff-4.0.3-25.el7_2.x86_64 26/27
Cleanup : jasper-libs-1.900.1-29.el7.x86_64 27/27
Verifying : libtiff-4.0.3-27.el7_3.x86_64 1/27
Verifying : libxcb-devel-1.11-4.el7.x86_64 2/27
Verifying : ghostscript-cups-9.07-20.el7_3.7.x86_64 3/27
Verifying : ilmbase-1.0.3-7.el7.x86_64 4/27
Verifying : libICE-devel-1.0.9-2.el7.x86_64 5/27
Verifying : freetype-devel-2.4.11-12.el7.x86_64 6/27
Verifying : libSM-devel-1.2.2-2.el7.x86_64 7/27
Verifying : bzip2-devel-1.0.6-13.el7.x86_64 8/27
Verifying : OpenEXR-libs-1.7.1-7.el7.x86_64 9/27
Verifying : libwmf-lite-0.2.8.4-41.el7_1.x86_64 10/27
Verifying : libjpeg-turbo-devel-1.2.90-5.el7.x86_64 11/27
Verifying : libtiff-devel-4.0.3-27.el7_3.x86_64 12/27
Verifying : ghostscript-devel-9.07-20.el7_3.7.x86_64 13/27
Verifying : libX11-devel-1.6.3-3.el7.x86_64 14/27
Verifying : xorg-x11-proto-devel-7.7-13.el7.noarch 15/27
Verifying : libXext-devel-1.3.3-3.el7.x86_64 16/27
Verifying : libXt-devel-1.1.4-6.1.el7.x86_64 17/27
Verifying : jasper-libs-1.900.1-30.el7_3.x86_64 18/27
Verifying : ImageMagick-devel-6.7.8.9-15.el7_2.x86_64 19/27
Verifying : ghostscript-9.07-20.el7_3.7.x86_64 20/27
Verifying : jasper-devel-1.900.1-30.el7_3.x86_64 21/27
Verifying : ImageMagick-6.7.8.9-15.el7_2.x86_64 22/27
Verifying : libXau-devel-1.0.8-2.1.el7.x86_64 23/27
Verifying : ghostscript-9.07-20.el7.x86_64 24/27
Verifying : libtiff-4.0.3-25.el7_2.x86_64 25/27
Verifying : ghostscript-cups-9.07-20.el7.x86_64 26/27
Verifying : jasper-libs-1.900.1-29.el7.x86_64 27/27

Installed:
ImageMagick-devel.x86_64 0:6.7.8.9-15.el7_2

Dependency Installed:
ImageMagick.x86_64 0:6.7.8.9-15.el7_2 OpenEXR-libs.x86_64 0:1.7.1-7.el7
bzip2-devel.x86_64 0:1.0.6-13.el7 freetype-devel.x86_64 0:2.4.11-12.el7
ghostscript-devel.x86_64 0:9.07-20.el7_3.7 ilmbase.x86_64 0:1.0.3-7.el7
jasper-devel.x86_64 0:1.900.1-30.el7_3 libICE-devel.x86_64 0:1.0.9-2.el7
libSM-devel.x86_64 0:1.2.2-2.el7 libX11-devel.x86_64 0:1.6.3-3.el7
libXau-devel.x86_64 0:1.0.8-2.1.el7 libXext-devel.x86_64 0:1.3.3-3.el7
libXt-devel.x86_64 0:1.1.4-6.1.el7 libjpeg-turbo-devel.x86_64 0:1.2.90-5.el7
libtiff-devel.x86_64 0:4.0.3-27.el7_3 libwmf-lite.x86_64 0:0.2.8.4-41.el7_1
libxcb-devel.x86_64 0:1.11-4.el7 xorg-x11-proto-devel.noarch 0:7.7-13.el7

Dependency Updated:
ghostscript.x86_64 0:9.07-20.el7_3.7 ghostscript-cups.x86_64 0:9.07-20.el7_3.7
jasper-libs.x86_64 0:1.900.1-30.el7_3 libtiff.x86_64 0:4.0.3-27.el7_3

Complete!

安裝成功之後,在 執行”gem install rmagick“,安裝成功

[[email protected] admin]# gem install rmagick -v ‘2.16.0‘
Building native extensions. This could take a while...
Successfully installed rmagick-2.16.0
Parsing documentation for rmagick-2.16.0
Installing ri documentation for rmagick-2.16.0
Done installing documentation for rmagick after 3 seconds
1 gem installed

Gem install rmagick 報錯問題~