I\'m having some issues installing Alamofire 4.0
into my project.
I\'ve got the latest version of Xcode, running Swift 3
I tried updating and didn't work. Finally , I had to completely remove (manually )cocoapods, cocoapods-core , cocoapods-try.. any other package use by cocoa pods. Use this terminal command to list all the packages : gem list --local | grep cocoa pods
After that , I also delete ./cocoapods folder from user root folder.
Open the Terminal
->
copy
below command
sudo gem install cocoapods
It will install the latest stable version of cocoapods
.
after that, you need to update pod using below command
pod setup
You can check pod version using below command
pod --version
For those with a sudo-less CocoaPods installation (i.e., you do not want to grant RubyGems admin privileges), you don't need the sudo
command to update your CocoaPods installation:
gem install cocoapods
You can find out where the CocoaPods gem is installed with:
gem which cocoapods
If this is within your home directory, you should definitely run gem install cocoapods
without using sudo
.
Finally, to check which CocoaPods you are currently running type:
pod --version
First check cocoapods version
like pod --version
then update like sudo gem install cocoapods --pre
after update you can also check cocoapods version.
If you got System Integrity Protection enabled or any other permission write error, which is enabled by default since macOS Sierra release, you should update CocoaPods, running this line in terminal:
sudo gem install cocoapods -n/usr/local/bin
After installing, check your pod version:
pod --version
You will get rid of this error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory
And it will install latest CocoaPods:
Successfully installed cocoapods-x.x.x
Parsing documentation for cocoapods-x.x.x
Installing ri documentation for cocoapods-x.x.x
Done installing documentation for cocoapods after 4 seconds
1 gem installed
You can solve this problem by these Commands:
First:
sudo gem install cocoapods
Desp: type user mac password now your cocoapods will be replace with a stable version.
You can find out where the CocoaPods gem is installed with:
gem which cocoapods
if you have cloned the repo then type this command:
pod repo update
close your xcode and run this command
Pod install