为什么我安装 rmagick 时遇到问题

发布于 2024-10-25 07:00:27 字数 1435 浏览 3 评论 0原文

在 Ruby 1.8.7 和 Rails 2.3.5 上我得到:

gem install rmagick

ERROR:  Error installing rmagick:

ERROR: Failed to build gem native extension.


    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
    mkmf.rb can't find header files for ruby at       
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for inspection.

Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

Building native extensions.  This could take a while...

Cynicalgrinch:levelous pawel$ gem install rmagick

Building native extensions.  This could take a while...

ERROR:  Error installing rmagick:

    ERROR: Failed to build gem native extension.


        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb

mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for inspection.

Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out


Gem_make.out says this:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

On Ruby 1.8.7 and rails 2.3.5 I get:

gem install rmagick

ERROR:  Error installing rmagick:

ERROR: Failed to build gem native extension.


    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
    mkmf.rb can't find header files for ruby at       
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for inspection.

Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out

Building native extensions.  This could take a while...

Cynicalgrinch:levelous pawel$ gem install rmagick

Building native extensions.  This could take a while...

ERROR:  Error installing rmagick:

    ERROR: Failed to build gem native extension.


        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb

mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1 for inspection.

Results logged to /Library/Ruby/Gems/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out


Gem_make.out says this:

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

野鹿林 2024-11-01 07:00:27

在 Ubuntu/Debian 上,您需要安装:

sudo apt-get install libmagickwand-dev

在 RedHat/Fedora/CentOS 上:

yum install ImageMagick-devel

on Ubuntu/Debian you would need to install:

sudo apt-get install libmagickwand-dev

on RedHat/Fedora/CentOS:

yum install ImageMagick-devel
不打扰别人 2024-11-01 07:00:27

要使用 gem 系统安装 rmagick,您的系统上必须有“imagemagick”。以下错误行表示 rmagick 无法构建,因为您的系统上不存在本机扩展 (imagemagick)。

ERROR: Failed to build gem native extension.

在 OSX 上,您可以使用 brew (我认为最好的方法)来安装 imagemagick。一旦安装了brew:

brew install imagemagick
gem install rmagick

在Mountain Lion(OSX)上,之后:

brew install imagemagick

在能够安装rmagick gem之前,可能需要手动强制重新创建一些符号链接。

> brew link -f jpeg
> brew link -f libpng
> brew link -f freetype
> brew link -f imagemagick

To install rmagick with the gem system, you must have "imagemagick" on your system. The following error line says that rmagick failed to build because the native extension (imagemagick) does not exist on your system.

ERROR: Failed to build gem native extension.

On OSX, you can use brew (the best way in my opinion) to install imagemagick. Once brew is installed :

brew install imagemagick
gem install rmagick

On Mountain Lion (OSX), after:

brew install imagemagick

it may be necessary to force the re-creation of some symlinks manually before being able to install the rmagick gem.

> brew link -f jpeg
> brew link -f libpng
> brew link -f freetype
> brew link -f imagemagick
ι不睡觉的鱼゛ 2024-11-01 07:00:27

在 fedora 上,确保您安装了 ImageMagick-devel

On fedora make sure you have ImageMagick-devel installed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文