为什么我安装 rmagick 时遇到问题
在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Ubuntu/Debian 上,您需要安装:
在 RedHat/Fedora/CentOS 上:
on Ubuntu/Debian you would need to install:
on RedHat/Fedora/CentOS:
要使用 gem 系统安装 rmagick,您的系统上必须有“imagemagick”。以下错误行表示 rmagick 无法构建,因为您的系统上不存在本机扩展 (imagemagick)。
在 OSX 上,您可以使用 brew (我认为最好的方法)来安装 imagemagick。一旦安装了brew:
在Mountain Lion(OSX)上,之后:
在能够安装rmagick gem之前,可能需要手动强制重新创建一些符号链接。
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.
On OSX, you can use brew (the best way in my opinion) to install imagemagick. Once brew is installed :
On Mountain Lion (OSX), after:
it may be necessary to force the re-creation of some symlinks manually before being able to install the rmagick gem.
在 fedora 上,确保您安装了
ImageMagick-devel
。On fedora make sure you have
ImageMagick-devel
installed.