Cocoapods声称要安装但不起作用 [英] Cocoapods claims to install but does not work

查看:105
本文介绍了Cocoapods声称要安装但不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 sudo gem install cocoapods 运行了cocoapods安装。

I ran the install of cocoapods by using sudo gem install cocoapods.

该命令声称已完成成功。但是,当我执行 gem list cocoapods 时,它不会显示在列表中。而当我做 pod --version 时,我得到一个错误:

The command claims to have completed successfully. However when I do gem list cocoapods it doesn’t show in list. And when I do pod --version I get an error:

/Users/myname/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)
    from /Users/myname/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems.rb:299:in `activate_bin_path'
    from /usr/local/bin/pod:23:in `<main>'

我尝试卸载并重新安装。我认为问题出在与Homebrew一起安装的较旧版本1.0.1,然后使用gem install在其上进行安装。但是我不确定。

I've tried uninstalling and reinstalling. I think the problem has to do with having an older version 1.0.1 that was installed with Homebrew, and then installing over it using gem install. But I’m not sure.

我也尝试卸载Homebrew版本,但是没有运气。

I also tried uninstalling the Homebrew version as well, but no luck.

推荐答案

我遵循了@oyvindhauge的建议,它的工作原理很迷人。只需输入:

I have followed @oyvindhauge advice and it worked like a charm. Just type:

gem install [gem]

祝你好运!

这篇关于Cocoapods声称要安装但不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆