我正在尝试使用ruby版本1.8.7在Mac OS X版本10.7.3上安装mechanize。问题在于其依赖性之一nokogiri。我看过其他有关安装xcode的帖子,我这样做的是版本4.3.2。这是我收到的错误。提前谢谢。
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
答案 0 :(得分:1)
我只需要为xcode安装命令行工具就可以了。必须编译nokogiri宝石。
答案 1 :(得分:1)
怎么样:
pip install mechanize
或
easy_install mechanize