本文介绍了无法在Mac上为ruby安装机械化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Mac OS X Version 10.7.3上安装机械化,并使用ruby 1.8.7版本。问题在于它的一个依赖nokogiri。我已经看到其他职位关于Xcode安装,我这样做是版本4.3.2。这是我收到的错误。

I am trying to install mechanize on a Mac OS X Version 10.7.3 with ruby version 1.8.7. The problem is with one of its dependencies nokogiri. I have seen other posts about having xcode installe and I do it is version 4.3.2 . Here is the error I am receiving. Thank you in advance.

sudo gem install mechanize
Building native extensions.  This could take a while...
ERROR:  Error installing mechanize:
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/nokogiri-1.5.2 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/nokogiri-1.5.2/ext/nokogiri/gem_make.out


推荐答案

我需要为xcode安装命令行工具,并且顺利进行。 nokogiri宝石必须被编译。

I needed to simply install the command line tools for xcode and it went smooth. The nokogiri gem has to be compiled.

这篇关于无法在Mac上为ruby安装机械化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 14:25