使用cocoapods出现某些错误

在更新cocoapods时,出现错误,找了半天终于在stackoverflow上找到答案:

/Users/myusername/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in`to_specs': Could not find 'cocoa pods' (>= 0) among 37 total gem(s) (Gem::LoadErrorfrom

/Users/quique123/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:309:in `to_spec'from

/Users/quique123/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gemfrom

/Users/quique123/.rvm/rubies/ruby-1.9.3-p194/bin/pod:22:in`'

答案:

Do not usesudo gem install cocoapodsif you havervminstalled. It creates a few problems. Follow these steps to fix your cocoapods installation:

Uninstall Cocoapods:

sudo gem uninstall cocoapods

Make sure you're on the latest Ruby:

which ruby

Installcocoapodswithoutsudo:

gem install cocoapods-V--no-ri--no-rdoc# V: Verbose; no-ri,no-rdoc: Do not install documentation

Set up Cocoapods:

pod setup

Should work now.

原来是我以前安装是用了sudo,导致位置不对

重新设置一下就行了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容