“rmagick”gem 安装问题

2024-05-16

我在尝试在 centos 上安装“rmagick”gem 时遇到问题。以下是我得到的输出。谁能帮我识别一下我缺少什么包裹?我已经安装了所有提到的另一个堆栈溢出线程:RMagick安装错误 https://stackoverflow.com/questions/7431707/rmagick-install-error

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    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... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... 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
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
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
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 stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.2. 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


Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

遵循建议后,现在我得到以下输出:

Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
    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... yes
checking for ImageMagick version >= 6.4.9... yes
checking for HDRI disabled version of ImageMagick... yes
checking for stdint.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
/usr/local/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:254:in `open'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
    from /usr/local/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
    from extconf.rb:194:in `<main>'


Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

mkmf.log 的输出:

checking for HDRI disabled version of ImageMagick... -------------------- yes

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

"gcc -o conftest -I/usr/local/include/ruby-1.9.1/x86_64-linux -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I.  -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6    -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/ImageMagick-6   conftest.c  -L. -L/usr/local/lib -Wl,-R/usr/local/lib  -L/usr/lib -lMagickCore-6.Q16      -L/usr/lib -lMagickCore-6.Q16    -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby-static  -lpthread -lrt -ldl -lcrypt -lm   -lc"
/usr/bin/ld: skipping incompatible /usr/lib/libMagickCore-6.Q16.so when searching for -lMagickCore-6.Q16
/usr/bin/ld: skipping incompatible /usr/lib/libMagickCore-6.Q16.so when searching for -lMagickCore-6.Q16
/usr/bin/ld: skipping incompatible /usr/lib/libMagickCore-6.Q16.so when searching for -lMagickCore-6.Q16
/usr/bin/ld: cannot find -lMagickCore-6.Q16
collect2: ld returned 1 exit status
checked program was:
/* begin */
1: #include "ruby.h"

gem_make.out 的输出与上面的终端输出相同。


尝试安装

  sudo apt-get install libmagickwand-dev imagemagick
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

“rmagick”gem 安装问题 的相关文章

  • Ruby Shoes 打包程序,包括应用程序中的 Shoes

    我似乎无法让 Ruby Shoes 打包程序正确创建包含 Shoes 的 exe 我正在使用 Raisins 版本 0 r1134 并从 github 替换 pack rb 打包程序制作的 exe 都是 70 80K 文件 它们显然不包括
  • Ruby/Rails/Rack 代码中的“use”关键字/单词

    最近我偶然在Ruby代码中看到这个词 use 当我正在查看一些与goliath https github com postrank labs goliath 中间件等 看起来它不同于include extend and require 有人
  • 视频无法使用 Paperclip Gem - Rails 中的 ffmpeg 上传

    我可以上传图像 但是 当我尝试上传视频时 它会显示为黑屏 并且播放按钮不起作用 我不确定我哪里错了 我需要视频播放器才能实现此功能吗 这可能是一个简单的解决方案 但是 我是 Rails 新手 任何帮助是极大的赞赏 谢谢 邮政模型 class
  • Ruby on Rails:有条件地显示部分内容

    我不确定我在这里是否采用了最好的方法 但我有一个数据块 我想在搜索完成后显示它 并且之前根本不存在 首先 没有什么可显示的 其次它引用的模型为零 因此它抛出异常 我将此块放置在部分模板中 并将其添加到布局中的适当位置 有没有办法有条件地干净
  • Rails 3.2.3 命名空间控制器被同名的全局控制器覆盖

    当全局应用程序控制器首先加载时 命名空间应用程序控制器在加载该命名空间内的页面时不会加载 应用程序控制器如下所示 class ApplicationController lt ActionController Base protect fr
  • Ruby 试图掌握一种新的表示法。 (inject(:) 与 select(and:even?);为什么有 &?)

    所以 我刚刚了解到 而不是写这样的东西 1 2 3 4 5 inject x y x y gt 15 我可以写 1 2 3 4 5 inject gt 15 我还了解到 而不是写 1 2 3 4 5 select x x even gt 2
  • 如何运行使用 Rails 模型的 Ruby 任务?

    我有一个带有一些基本模型的 Rails 应用程序 该网站显示从其他来源检索到的数据 因此 我需要编写一个 Ruby 脚本来在数据库中创建新实例 我知道我可以使用测试挂钩来做到这一点 但我不确定这在这里是否有意义 我不确定这个任务应该是什么样
  • 需要帮助获取嵌套的 ruby​​ 哈希层次结构

    我有哈希深层嵌套哈希 我希望每个键的层次结构 父到子 作为数组 例如 hash properties gt one gt extra headers gt type gt object type1 gt object2 entity gt
  • 分别对用户和管理员进行身份验证

    class ApplicationController lt ActionController Base protect from forgery skip before filter authenticate user only gt w
  • Ruby 电子表格 gem,如何居中对齐数字

    我在用着http spreadsheet rubyforge org http spreadsheet rubyforge org生成电子表格 但我遇到了一些问题 我正在打开现有工作簿并向其中添加数据 我已经设法在某种程度上使数字格式正常工
  • 在 Ruby 中创建带有静态页面的博客的最佳方法

    我刚刚访问了静态网站生成 http www ruby toolbox com categories static website generation html on 红宝石工具箱 http www ruby toolbox com 我不知
  • 地图、每个和收集之间有什么区别? [复制]

    这个问题在这里已经有答案了 在 Ruby 中 功能之间有什么区别吗 each map and collect each不同于map and collect but map and collect是相同的 技术上map是一个别名collect
  • Rails Partial (Rails 3, HAML) 任意慢

    我使用的是 Rails 3 0 1 HAML 0 3 22 和 Mongrel 1 1 5 MongoMapper 不是 AR 我正在渲染一个列表 每个列表项都是它自己的部分 每次页面渲染其中一个列表项部分时 渲染时间都会延长近 100 倍
  • 如何使用 watir 滚动网页

    我正在尝试滚动网页以查找并单击页面滚动时延迟加载的内容 我正在使用以下命令 require watir webdriver browser Watir new firefox browser send keys space 我在 Firef
  • 回形针如何更改基本名称(文件名)?

    我正在尝试更改照片的基本名称 文件名 在我的模型中我有 attr accessor image url basename has attached file image styles gt original gt 300x250 gt pn
  • 在 Rails 4 中渲染部分/rake 任务/后台作业/模型中的视图

    我读过很多关于在 rake 任务 后台作业 模型中渲染 Rails 部分和视图的内容 我在 Stackoverflow 和网络上找到的绝大多数内容都描述了在 Rails 3 中工作的方法 但它们似乎已经过时了 而且我没有让它们工作 即使花了
  • Rails:渲染不起作用,仍然出现“模板丢失”

    我目前正在学习 Rails 指南 我完成了这些步骤 但仍然遇到错误 我的 Ruby 版本是ruby 2 1 1p76Rails 版本是4 0 4 按照指南的指示 我创建了一个Article Controller class Articles
  • 无需别名的 Ruby YAML 编写

    我正在从 ruby 将数据写入 yaml 文件 并且经常在该文件上添加别名 像 id001 somekey somevalue id001 就我而言 我使用 yaml 文件来aid可读性并将名称添加到文件中的值 因为现有数据只是 没有键的分
  • 在任意时间范围内找到最佳日/月/年间隔的算法?

    如果您有时间表 请说 March 19 2009 July 15 2011 是否有一种算法可以将该时间范围分解为 March 19 2009 March 31 2009 complete days April 1 2009 December
  • 使用复选框过滤列表

    我有一个电影列表及其评级 在我的页面顶部 我有一个表单 其中提供了一个复选框列表 其中显示了每个可用的评级 G PG 13 等 一旦用户单击复选框并点击提交 我只想显示所选的电影 在我的索引方法中 我有一个名为的实例变量 filtered

随机推荐