解决Fedora下RMagic无法安装的问题

初次安装时,出现以下错误

[root@www Tim]# gem install rmagick
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb install rmagick
checking for Ruby version >= 1.8.2... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.5.2. Can't find Magick-config in /usr/kerberos/sbin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/home/Tim/bin


*** 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/bin/ruby

Gem files will remain installed in /usr/lib64/ruby/gems/1.8/gems/rmagick-2.5.2 for inspection.
Results logged to /usr/lib64/ruby/gems/1.8/gems/rmagick-2.5.2/ext/RMagick/gem_make.out
[root@www Tim]#


根据提示,应该是缺少magick库

[root@www Tim]# yum install ImageMagick-devel
Loaded plugins: fastestmirror, presto, refresh-packagekit
Setting up and reading Presto delta metadata
No Presto metadata available for livna
No Presto metadata available for Fedora
No Presto metadata available for adobe-linux-i386
No Presto metadata available for updates
No Presto metadata available for freshrpms
No Presto metadata available for fusion
Loading mirror speeds from cached hostfile
* livna: rpm.livna.org
* fedora: ftp.riken.jp
* adobe-linux-i386: linuxdownload.adobe.com
* updates: ftp.riken.jp
* freshrpms: ayo.ie.freshrpms.net
* fusion:
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package ImageMagick-devel.x86_64 0:6.3.8.1-4.fc9 set to be updated
--> Processing Dependency: jasper for package: ImageMagick-devel
--> Processing Dependency: ghostscript-devel for package: ImageMagick-devel
--> Processing Dependency: lcms-devel for package: ImageMagick-devel
--> Running transaction check
---> Package jasper.x86_64 0:1.900.1-8.fc9 set to be updated
---> Package ghostscript-devel.x86_64 0:8.62-4.fc9 set to be updated
---> Package lcms-devel.x86_64 0:1.17-5.fc9 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
ImageMagick-devel x86_64 6.3.8.1-4.fc9 fedora 77 k
Installing for dependencies:
ghostscript-devel x86_64 8.62-4.fc9 updates 44 k
jasper x86_64 1.900.1-8.fc9 fedora 18 k
lcms-devel x86_64 1.17-5.fc9 updates 50 k

Transaction Summary
=============================================================================
Install 4 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 189 k
Is this ok [y/N]: y
Downloading Packages:
Downloading DeltaRPMs:
Rebuilding rpms from deltarpms
(1/4): jasper-1.900.1-8.fc9.x86_64.rpm | 18 kB 00:05
(2/4): ghostscript-devel-8.62-4.fc9.x86_64.rpm | 44 kB 00:08
(3/4): lcms-devel-1.17-5.fc9.x86_64.rpm | 50 kB 00:14
(4/4): ImageMagick-devel-6.3.8.1-4.fc9.x86_64.rpm | 77 kB 00:17
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : jasper [1/4]
error: failed to stat /media/disk: No such file or directory
Installing : ghostscript-devel [2/4]
Installing : lcms-devel [3/4]
Installing : ImageMagick-devel [4/4]

Installed: ImageMagick-devel.x86_64 0:6.3.8.1-4.fc9
Dependency Installed: ghostscript-devel.x86_64 0:8.62-4.fc9 jasper.x86_64 0:1.900.1-8.fc9 lcms-devel.x86_64 0:1.17-5.fc9
Complete!


再次安装gem:

成功了,爽

[root@www Tim]# gem install rmagick --include-dependencies
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Building native extensions. This could take a while...
Successfully installed rmagick-2.5.2
1 gem installed

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/c1d5c3f96ddbe21dadedded24b3f3775.html