安装rmagick(2.13.2)时发生错误,Bundler无法继续[重复]

时间:2022-10-11 05:28:12

This question already has an answer here:

这个问题在这里已有答案:

using gem magick' and am using rails 3.1.0

使用gem magick'并使用rails 3.1.0

Fetching gem metadata from http://rubygems.org/.........

Fetching additional metadata from http://rubygems.org/..

Resolving dependencies...


Using rake (10.1.1)
Using multi_json (1.8.4)
Using activesupport (3.1.0)
Using bcrypt-ruby (3.0.1)
Using builder (3.0.4)
Using i18n (0.6.9)
Using activemodel (3.1.0)
Using erubis (2.7.0)
Using rack (1.3.10)
Using rack-cache (1.0.3)
Using rack-mount (0.8.3)
Using rack-test (0.6.2)
Using hike (1.2.3)
Using tilt (1.3.7)
Using sprockets (2.0.4)
Using actionpack (3.1.0)
Using mime-types (1.25.1)
Using polyglot (0.3.4)
Using treetop (1.4.15)
Using mail (2.3.3)
Using actionmailer (3.1.0)
Using arel (2.2.3)
Using tzinfo (0.3.38)
Using activerecord (3.1.0)
Using activeresource (3.1.0)
Using ansi (1.4.3)
Using bundler (1.5.2)
Using carrierwave (0.5.8)
Using coffee-script-source (1.7.0)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.3)
Using json (1.8.1)
Using rdoc (3.12.2)
Using thor (0.14.6)
Using railties (3.1.0)
Using coffee-rails (3.1.1)
Using jquery-rails (3.1.0)
Using mysql2 (0.3.15)
Using rails (3.1.0)


Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.


        /usr/bin/ruby1.9.1 extconf.rb 
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes

checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

*** 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/ruby1.9.1


Gem files will remain installed in /home/rithujadav/.bundler/tmp/3624/gems/rmagick-2.13.2 for inspection.

Results logged to /home/rithujadav/.bundler/tmp/3624/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

An error occurred while installing rmagick (2.13.2), and Bundler cannot
continue.
Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.

3 个解决方案

#1


52  

You should install ImageMagick first:

您应该首先安装ImageMagick:

sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev

#2


29  

On Mac, I did brew install imagemagick.

在Mac上,我做了brew install imagemagick。

That successfully allowed me to run gem install rmagick -v '2.13.2' without issues.

这成功地让我运行gem install rmagick -v'2.13.2'没有问题。

#3


2  

Try

尝试

$ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

or

要么

$ export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH"

and then $ gem install rmagick should work

然后$ gem install rmagick应该工作

#1


52  

You should install ImageMagick first:

您应该首先安装ImageMagick:

sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev

#2


29  

On Mac, I did brew install imagemagick.

在Mac上,我做了brew install imagemagick。

That successfully allowed me to run gem install rmagick -v '2.13.2' without issues.

这成功地让我运行gem install rmagick -v'2.13.2'没有问题。

#3


2  

Try

尝试

$ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

or

要么

$ export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig:$PKG_CONFIG_PATH"

and then $ gem install rmagick should work

然后$ gem install rmagick应该工作