AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 662733
Accepted
Cojones
Cojones
Asked: 2015-01-28 07:44:24 +0800 CST2015-01-28 07:44:24 +0800 CST 2015-01-28 07:44:24 +0800 CST

服务器更新后无法安装 rmagick

  • 772

我正在运行一个 debian 服务器并在一段时间后升级了所有软件包(apt-get update, apt-get upgrade, apt-get distro-upgrade)。然后 rmagick 不再工作,因为 imagemagick 已更新。

所以我跑了:

gem uninstall rmagick
bundle install

然后我得到了这个:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 0.0.0. Can't find Magick-config in /usr/local/bin:/usr/bin:/bin:/usr/local/games:/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/local/bin/ruby

extconf failed, exit code 1

Gem files will remain installed in /srv/www/www.example.com/shared/vendor/bundle/ruby/2.1.0/gems/rmagick-2.13.3 for inspection.
Results logged to /srv/www/www.example.com/shared/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/rmagick-2.13.3/gem_make.out
An error occurred while installing rmagick (2.13.3), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.13.3'` succeeds before bundling.

这是cat mkmf.log:

    checking for Ruby version >= 1.8.5... -------------------- yes

--------------------

find_executable: checking for gcc... -------------------- yes

--------------------

find_executable: checking for Magick-config... -------------------- no

--------------------

Can't install RMagick 0.0.0. Can't find Magick-config in /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

谁能帮我这个?

--- 更新 1 ---

在安装了一些 graphicsmagic 的东西之后,我得到了一些进一步的信息:

apt-get install graphicsmagick-libmagick-dev-compat
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libmagick++-6-headers libmagick++-6.q16-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  libmagick++-dev libmagickcore-dev
The following NEW packages will be installed:
  graphicsmagick-libmagick-dev-compat
0 upgraded, 1 newly installed, 2 to remove and 1 not upgraded.
Need to get 0 B/26.2 kB of archives.
After this operation, 267 kB disk space will be freed.
Do you want to continue? [Y/n]

这是bundle install输出:

checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 0.0.0. Can't find MagickWand.h.
*** 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/bin/ruby

extconf failed, exit code 1

这对我们有任何帮助吗?

* --- 更新 2 --- *

单独安装后graphicsmagick-libmagick-dev-compat,libmagickcore-dev我尝试安装libmagick++-dev

apt-get install libmagick++-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  graphicsmagick-libmagick-dev-compat
The following NEW packages will be installed:
  libmagick++-dev
0 upgraded, 1 newly installed, 1 to remove and 1 not upgraded.
Need to get 0 B/121 kB of archives.
After this operation, 115 kB of additional disk space will be used.
ruby-on-rails
  • 3 3 个回答
  • 5956 Views

3 个回答

  • Voted
  1. Linostar
    2015-02-07T04:45:26+08:002015-02-07T04:45:26+08:00

    问题很简单。在您的系统上的任何地方都找不到 Magick-config。当您卸载 imagemagick 时,它也被卸载了 - 显然您没有再次使用 imagemagick 安装它。要解决此问题,请安装以下软件包:

    sudo apt-get install libmagick++-dev graphicsmagick-libmagick-dev-compat libmagickcore-dev

    然后重新运行 gem 安装过程。

    • 2
  2. Best Answer
    Cojones
    2015-02-24T02:12:34+08:002015-02-24T02:12:34+08:00

    对于将来遇到此问题的人:我花了很长时间,但已解决。这就是我所做的:

    sudo apt-get purge imagemagick libmagickcore-dev libmagickwand-dev
    sudo rm -R /usr/include/ImageMagick-6/magick
    sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
    sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev
    
    • 0
  3. Shekhar Prasad Rajak
    2017-01-25T06:10:57+08:002017-01-25T06:10:57+08:00

    可能您正在安装 ImageMagick 版本 7.xx,它将在您的文件夹中生成不同的文件夹名称usr/lib/local/include/ImageMagick7.x.x。

    在 ImageMagick6.xx 版本中,我们有magick,wand命名文件夹,在 ImageMagick7.xx 版本中命名为MagickCore, MagickWand。因此,此更新导致某些 gem 安装出现问题,例如此处。哪个正在使用 magick/some_header.h或wand/some_header.h(意味着它们没有使用新的 7.xx ImageMagick 版本进行更新)。

    这就是我们收到此错误的原因:

    ```

    checking for outdated ImageMagick version (<= 6.4.9)... no
    checking for presence of MagickWand API (ImageMagick version >= 6.9.0)... no
     .... 
    checking for wand/MagickWand.h... no
    

    ```

    在日志文件中是这样的:

    error: 'MagickCore/method-attribute.h' file not found
    #include "MagickCore/method-attribute.h"
             ^
    

    解决方案

    从官方网站在您的系统中安装 ImageMagick6.xx 版本:https ://www.imagemagick.org/download/并使用以下命令安装它(解压缩 zip/tar 后):

    ./configure
    make 
    make install
    

    然后做

    gem install rmagick

    它会起作用的。

    • 0

相关问题

  • 清漆配置仅缓存未登录用户

  • Gzip 与反向代理缓存

  • 我应该将 Rails 应用程序部署到哪个目录?

  • 跨地理位置不同的服务器的 MySQL 复制

  • 在 Windows Server 2003 上通过 SSH 启动和停止 Mongrel 服务

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve