Cocoapods claims to install but does not work

与世无争的帅哥 提交于 2020-01-05 09:10:01

问题


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

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>'

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.

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


回答1:


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

gem install [gem]

Good luck!



来源:https://stackoverflow.com/questions/46438176/cocoapods-claims-to-install-but-does-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!