升级10.10 Yosemite 后,cocoapods 出现错误(解决方案)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
RSMacBook-Pro:~ RS$ pod search jsonkit
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- xcodeproj/prebuilt/universal.x86_64-darwin14-2.0.0/xcodeproj_ext (LoadError)
     from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
     from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:6:in `rescue in <top (required)>'
     from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj/ext.rb:3:in `<top (required)>'
     from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
     from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
     from /Library/Ruby/Gems/2.0.0/gems/xcodeproj-0.17.0/lib/xcodeproj.rb:30:in `<top (required)>'
     from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
     from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
     from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods.rb:2:in `<top (required)>'
     from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
     from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
     from /Library/Ruby/Gems/2.0.0/gems/cocoapods-0.33.1/bin/pod:32:in `<top (required)>'
     from /usr/bin/pod:23:in `load'
     from /usr/bin/pod:23:in `<main>'

 一直想尝试新系统,由于担心bug会导致开发遇到一系列问题,一直忍住没有升级,前两天升级了,就立刻遇到这个问题。

无法对cocoapods进行操作,stackoverflow上有个解决方案,被多人转载,可惜didn't work for me. 于是我试着重新安装ruby,解决了

方案一:(适用于大多数人)

Open Xcode 6 打开Xcode 6 —— 系统偏好设置 —— 位置 —— 把命令行工具改为Xcode 6.0

卸载 cocoapods —— 重新安装 xcodeproj —— 重新安装 cocoapods

$ sudo gem uninstall cocoapods

$ sudo gem install xcodeproj

$ sudo gem install cocoapods
如果没有问题,运行pod --version 查看安装是否成功

如果,不幸的是,上述操作无法解决,就要和楼主一样了

1.更新rbenv        

$ curl -L get.rvm.io | bash -s stable

2.重新安装ruby

$ rvm install ruby 2.1.1

3.重新安装cocoapods

$ sudo gem install cocoapods

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值