2015-04-12 99 views
0

我想,当我打宝石安装机械化,几秒钟后,我的Mac操作系统上安装mechainze宝石,但是,POP操作了:奇怪的错误安装在Mac OS mechainze宝石时

Building native extensions. This could take a while... 
ERROR: Error installing mechanize: 
    ERROR: Failed to build gem native extension. 

    /Users/Tim/.rvm/rubies/ruby-1.9.3-p545/bin/ruby extconf.rb 
checking for main() in -lstdc++... yes 
checking for ruby/encoding.h... yes 
creating Makefile 

make clean 

make 
compiling unf.cc 
g++: error: unrecognized command line option '-Wshorten-64-to-32' 
make: *** [unf.o] Error 1 

make failed, exit code 2 

Gem files will remain installed in /Users/Tim/.rvm/gems/[email protected]/gems/unf_ext-0.0.6 for inspection. 
Results logged to /Users/Tim/.rvm/gems/[email protected]/extensions/x86_64-darwin-12/1.9.1/unf_ext-0.0.6/gem_make.out 

我不知道为什么会发生这种情况,有没有人愿意帮忙?

谢谢! PS:我发现实际上很久以前我把默认编译器设置为g ++而不是clang。这很重要吗?

回答

0

实际上,这确实是由我将默认编译器切换到gcc4.7引起的。切换回来后(命令:sudo port select --set gcc llvm-gcc42),它顺利运行。