2

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.

bfontaine
  • 18,169
  • 13
  • 73
  • 107
David Choi
  • 6,131
  • 10
  • 28
  • 28
  • Trying to use this https://stackoverflow.com/questions/35914557/how-to-get-cocoapods-running-with-rvm, but cannot find .gemrc. – David Choi Sep 27 '17 at 03:19
  • 1
    I suspect you have installed cocoapods on your system default Ruby since you are using sudo. When using RVM, you should simply use gem install [the gem] – oyvindhauge Sep 27 '17 at 11:08

1 Answers1

1

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

gem install [gem]

Good luck!

brasofilo
  • 25,496
  • 15
  • 91
  • 179
Luiz Durães
  • 744
  • 9
  • 17