I\'m having some issues installing Alamofire 4.0
into my project.
I\'ve got the latest version of Xcode, running Swift 3
Execute the following on your terminal to get the latest stable version:
sudo gem install cocoapods
Add --pre
to get the latest pre release:
sudo gem install cocoapods --pre
If you originally installed the cocoapods gem using sudo
, you should use that command again.
Later on, when you're actively using CocoaPods by installing pods, you will be notified when new versions become available with a CocoaPods X.X.X is now available, please update message.
Below are steps to update cocoapods :
Press cmd + space tab
to open Spotlight then text in terminal
)pod setup
command. This will setup cocoapods master repo.pod --version
command. If you are using Homebrew, open terminal and type:
brew upgrade cocoapods
If that does not work, try:
brew install cocoapods
This is a really quick & detailed solution
Open the Terminal and execute the following to get the latest stable version:
sudo gem install cocoapods
Add --pre to get the latest pre release:
sudo gem install cocoapods --pre
Incase any error occured
Try uninstall and install again:
sudo gem uninstall cocoapods
sudo gem install cocoapods
Run after updating CocoaPods
sudo gem clean cocoapods
After updating CocoaPods, also need to update Podfile.lock file in your project.
Go to your project directory
pod install
I change the line "pod 'Alamofire', '~> 4.0'" to "pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire', :commit => '3cc5b4e'" after that in terminal: "pod install --repo-update" and it works.
Non of the above solved my problem, you can check pod version using two commands
pod --version
gem which cocoapods
In my case pod --version
always showed "1.5.0" while gem which cocopods
shows
Library/Ruby/Gems/2.3.0/gems/cocoapods-1.9.0/lib/cocoapods.rb
. I tried every thing but unable to update version showed from pod --version
. sudo gem install cocopods
result in installing latest version but pod --version
always showing previous version. Finally I tried these commands
sudo gem update
sudo gem uninstall cocoapods
sudo gem install cocopods
pod setup``pod install
catch for me was sudo gem update. Hopefully it will help any body else.