1.安装pod的时候报错如下:
Last login: Sun Oct 18 07:49:45 on console
appledeMac-Pro:~ apple$ sudo gem install cocoapods
Password:
Building native extensions. This could take a while...
ERROR: Error installing cocoapods
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20151018-1680-1ggny42.rb extconf.rbcreating Makefilemake "DESTDIR=" cleanmake "DESTDIR="compiling generator.clinking shared-object json/ext/generator.bundleclang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]clang: note: this will be a hard error (cannot be downgraded to a warning) in the futuremake: *** [generator.bundle] Error 1make failed, exit code 2Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.3 for inspection.Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/json-1.8.3/gem_make.out
2.尝试各种办法都没管用,后面找到一个办法说是Xcode从5.1起给编译器规定对于未知参数传入视为error,我们需要使用ARCHFLAGS将该error降级为warning,因此最后的安装命令应该如下:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install cocoapods
3.接着就是一连串的Successfully,终于搞定!