cocoapods安装失败解决办法

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.尝试各种办法都没管用,后面找到一个办法说是Xcode5.1起给编译器规定对于未知参数传入视为error,我们需要使用ARCHFLAGS将该error降级为warning,因此最后的安装命令应该如下:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install cocoapods

3.接着就是一连串的Successfully,终于搞定!


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值