skip to Main Content

I tried updating cocoapods with "sudo gem install cocoapods" and it is stated that the latest cocoapods has been installed. However, when I run "pod –version", it still shows that the version is at my previous cocoapods version. Any suggestions on how to update to the latest version?

xx@xx-MacBook-Air ios % sudo gem install cocoapods
Password:
Successfully installed cocoapods-1.11.3
Parsing documentation for cocoapods-1.11.3
Done installing documentation for cocoapods after 1 seconds
1 gem installed
xx@xx-MacBook-Air ios % pod setup                 
Setup completed
xx@xx-MacBook-Air ios % pod --version             
1.10.1

I tried to uninstall cocoapods and reinstall it, following this suggestion with the following codes:

xx@xx-MacBook-Air ios % sudo gem uninstall cocoapods
Remove executables:
        pod, sandbox-pod

in addition to the gem? [Yn]  y
Removing pod
Removing sandbox-pod
Successfully uninstalled cocoapods-1.11.3
xx@xx-MacBook-Air ios % pod --version               
1.10.1
xx@x-MacBook-Air ios % sudo gem uninstall cocoapods
Gem 'cocoapods' is not installed
xx@xx-MacBook-Air okepos % sudo gem install cocoapods  
Fetching cocoapods-1.11.3.gem
Successfully installed cocoapods-1.11.3
Parsing documentation for cocoapods-1.11.3
Installing ri documentation for cocoapods-1.11.3
Done installing documentation for cocoapods after 2 seconds
1 gem installed
xx@xx-MacBook-Air ios % pod --version
1.10.1

But even after I have uninstalled cocopods, the pod –version still shows the previous version. I tried re-installing the latest version again but the version still shows 1.10.1

2

Answers


  1.    sudo gem install cocoapods
    

    Stop right there. The fact that you have to say sudo is the problem. This suggests that you are trying to install gems into the System ruby. You must not do that.

    Use homebrew to install rbenv and use rbenv to configure your own global ruby. Use it and no other from now on.

    Login or Signup to reply.
  2. Use which pod to figure out where it’s installed. Most likely it’s through brew, so you need to do a brew upgrade to get the latest version. Generally it’s best to install all Ruby tools through the same method: directly, through brew, or using a Ruby manager like rvm.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search