I am a newbie in cocoapods and I would be appreciated if you help.
Today I want to use cocoapods to manager my dependencies in my project.
So my Profile is:
platform :ios, '8.0'
target 'TargetName' do
pod 'AFNetworking', '~> 3.0'
end
But after running pod install, I got the message as follow:
pod install
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.1.0)
Generating Pods project
[1] 53417 abort pod install
After that, I can't find the TargetName.xcworkspace and the Podfile.lock but the Pods folder is there.
That's weird because there are no more error messages here.
I installed the cocoapods exactly according to the official guides. And here are the environments:
pod: 1.1.1
ruby: 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]
gem: 2.6.8
Xcode: 8.2.1
Thank you very much!
Finally I upgrade cocoapods(now Version 1.2.0.beta.1) and solve my problem.
When try to install pod file two components return error in terminal.
I am using Objective-c and iOS9.
please help me.
podfile:
pod 'DZNPhotoPickerController', '~> 1.6'
pod 'SDWebImage', '~> 3.7'
Errors in terminal:
pod install
Updating local specs repositories
Analyzing dependencies
[!] Unable to satisfy the following requirements:
SDWebImage (~> 3.7) required by Podfile
SDWebImage (= 3.7.3) required by Podfile.lock
SDWebImage (= 3.7) required by DZNPhotoPickerController/Core (1.6.0)
Reza Jan,
you can delete Podfile.lock and try pod install again. It will help with your second line of error. and remove pod 'SDWebImage', '~> 3.7' because it will be added as a dependency of DZNPhotoPickerController anyway.
Cheers
I had some problems with one version of the project. I've found this answer where someone suggest steps to remove all cocoapods-connected stuff from the machine and reinstall it. I did follow the steps:
$ 'pod --version'
0.36.1
$ gem list --local | grep cocoapods
cocoapods (0.39.0.rc.1, 0.38.2, 0.38.1, 0.37.2)
cocoapods-core (0.39.0.rc.1, 0.38.2, 0.38.1, 0.37.2)
cocoapods-downloader (0.9.3, 0.9.1)
cocoapods-plugins (0.4.2)
cocoapods-search (0.1.0)
cocoapods-stats (0.6.2, 0.5.3)
cocoapods-trunk (0.6.4, 0.6.1)
cocoapods-try (0.5.1, 0.4.5)
$ gem uninstall cocoapods // and all others from the list above
The problem is that when i again grep all cocoapods, the list was equal to upper one, nothing disappeared.
$ sudo gem uninstall cocoapods
Select gem to uninstall:
1. cocoapods-0.37.2
2. cocoapods-0.38.1
3. cocoapods-0.38.2
4. cocoapods-0.39.0.rc.1
5. All versions
> 5
$ pod --version
// here was the error command not found, so everything fine
$ sudo gem install cocoapods
Fetching: cocoapods-0.38.2.gem (100%)
Successfully installed cocoapods-0.38.2
Parsing documentation for cocoapods-0.38.2
Installing ri documentation for cocoapods-0.38.2
Done installing documentation for cocoapods after 2 seconds
1 gem installed
$ pod --version
Could not find proper version of cocoapods (0.36.1) in any of the sources
Run `bundle install` to install missing gems.
But why does it want me to install 0.36.1? Anyway, as it asked, I did:
$bundle install
Installing cocoapods-core 0.36.1
Installing cocoapods-downloader 0.8.1
Installing cocoapods-plugins 0.4.1
Installing cocoapods-trunk 0.6.0
Installing cocoapods-try 0.4.3
Installing cocoapods 0.36.1
// Many "using" dependencies
So now when I run:
$ pod --version
0.36.1
And I'm stuck :) Why can't I have newest release version? Maybe pod --version points to the newest version of cocoapods-core instead of only cocoapods, so everything is ok and I have the correct version?
Check if you use Gemfile and there is specified the version of
cocoapods.
You can use specific version by pod *version* action. For example: pod _1.5.0.beta.1_ update or pod _1.5.0.beta.1_ install
For anyone coming to this in an attempt to update cocoapods. After doing all of the above I wasn't able to get this resolved. I then headed to the resolved answer and being unwilling to remove RVM, I tried to resolve this issue another way.
I found that my issue did indeed lie in my Gemfile.
First, run
gem install cocoapods to ensure you have the latest version, or whatever specified version you were looking for downloaded.
Second, ensure your projects Gemfile hasn't specified a cocoapods version number and instead simply specifies it as:
gem "cocoapods"
If yours doesn't, change this and run bundle update to regenerate the Gemfile.lock file and your problem should be solved. If not, go ahead and delete the Gemfile.lock file altogether and then run bundle update. You can easily check to see which gem version will be loaded by opening the Gemfile.lock file and searching for cocoapods-core <version number here>
At this point, you can go into your project and run
pod setup
and then check the cocoapods version with
pod --version
and now FINALLY you are free to run
pod install
to replace the Podfile.lock file and get back to your happy dev life. Hope that helps someone and saves them from burning hours.
It seems something got messed up in my ruby version. I still have no idea what and why. I've managed to fix it via this solution: https://stackoverflow.com/a/25021772/849616. After it everything works correctly.
You might face this issue when it comes migrating to a higher Swift version. Assuming that you already have cocoapods installed, you probably need to run bundle update command (possibly with sudo).
For more details, you could check: https://guides.cocoapods.org/using/a-gemfile.html
Additionally, I'd suggest to do the following:
Install the latest Xcode version.
Clear derived data (not just clean project) in your project.
Run pod update command.
I have the same problem.
In my project, pod --version and gem which cocoapods always return diffrence version.
All I had to do is remove Gemfile.lock in my project and bundle install again. It removed the locked cocoapods version and install a new one.
Hope that helps some one here.
I ran pod install and I've got this error:
Could not find proper version of cocoapods (1.11.3) in any of the sources
and I ran:
bundle install
after that pod install worked properly
In our project we want to ensure that all developers are using the same version of CocoaPods by adding a version verification within the Podfile as a prerequisite check when a developer attempts to perform pod install or pod update.
Is it possible to achieve this from within the Podfile?
To do this you'll need to create a Gemfile, which is like a Podfile for RubyGems, which CocoaPods is distributed as. There is a guide to do this for CocoaPods here. Mainly you'll create a Gemfile with something like:
source 'https://rubygems.org'
gem 'cocoapods', '~> 0.38.2'
Then you can install your specified version with bundle install. This will install the same version on all developer's machines. After that you'll run bundle exec pod install to make sure that pod install is run by the version specified in your Gemfile (which may not be the case if the user has multiple version of CocoaPods installed).
This is my setup:
Mavericks 10.9.1
Xcode 5.0.2
which ruby returns this:
/Users/quique123/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
but dvm install ruby returns:
Already installed ruby-2.1.0.
To reinstall use:
rvm reinstall ruby-2.1.0
So doesn't this mean I have ruby 2.1.0?
gems list says I have installed cocoa pods & cocoapods-core 0.29.0 and some other gems.
After sudo gem install cocoa pods I get the bunch of fetches and change log and Successfully Installed cocoa pods 0.29.0. It then parses and installs documentation and when I run pod setup I got:
Setting up CocoaPods master repo
Setup completed (read-only access)
So I created a file from a tutorial:
platform :iOS, '7.0'
pod 'Mantle'
pod 'TSMessages'
pod 'ReactiveCocoa'
but when I run pod install I get:
/Users/myusername/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:298:in `to_specs': Could not find 'cocoa pods' (>= 0) among 37 total gem(s) (Gem::LoadError)
from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:309:in `to_spec'
from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_gem.rb:53:in `gem'
from /Users/quique123/.rvm/rubies/ruby-1.9.3-p194/bin/pod:22:in `<main>'
How do I get the pod to install correctly and why am i getting messages of ruby 1.9.3?
If you have rvm installed do not use sudo gem install cocoapods. It creates problems. Follow these steps to fix your cocoapods installation:
Uninstall Cocoapods:
sudo gem uninstall cocoapods
Make sure you're on the latest Ruby:
which ruby
Install cocoapods without sudo:
gem install cocoapods -V --no-ri --no-rdoc
# V: Verbose; no-ri,no-rdoc: Do not install documentation
Set up Cocoapods:
pod setup
Should work now.