First according to this article: http://blog.csdn.net/dqjyong/article/details/37958067
The procedure is as follows:
- Open xcode 6
- Open preferences
- Click
Locations
Tab
- Change
Command Line Tools
VersionXcode 6.0
- Uninstall
cocoapods
A.$ sudo gem uninstall cocoapods
- Install
xcodeproj
A.$ sudo gem install xcodeproj
- Install
cocoapods
A.$ sudo gem install cocoapods
- Run
pod --version
To verify that it worked
If you execute Step 7: sudo gem install xcodeproj successfully, but to Step 7:
$ sudo gem install cocoapods
The error message is as follows:
ERROR: Could not find a valid gem ‘cocoapods‘ (>= 0), here is why: Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://rubygems.org/latest_specs.4.8.gz)ERROR: Possible alternatives: cocoapods
Consciousness means that we cannot find the source we need in the official source. What should we do now? Find a blog online and switch the official source, that is, change the source retrieval address.
In this case, we need to change the gem source. For details, refer to [4] and [5]. Run the following command on the terminal:
$ gem sources -l
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
Run the following command:
$ Pod setup
This processWillLikely take a while as this command clones the cocoapods specs Repository
Into ~ /. Cocoapods/on your computer. [6]
So far, cocoapods has been installed.
Note:If the "$ pod setup" command is missing, directly execute "$ pod init"
There will be an error similar to the following:
"$ Pod init
Setting up cocoapods master Repo
[!] /Usr/bin/git clone 'https: // github.com/cocoapods/specs.git' master -- depth = 1
Cloning into 'master '...
Error: RPC failed; Result = 52, HTTP code = 0
Fatal: the remote end hung up unexpectedly
/Library/Ruby/gems/2.0.0/gems/claide-0.6.1/lib/claide/command. RB: 304: In 'handle _ exception': Undefined method 'verbose? 'For Nil: nilclass (nomethoderror)
From/library/Ruby/gems/2.0.0/gems/claide-0.6.1/lib/claide/command. RB: 284: In 'rescue in run'
From/library/Ruby/gems/2.0.0/gems/claide-0.6.1/lib/claide/command. RB: 274: In 'run'
From/library/Ruby/gems/2.0.0/gems/cocoapods-0.33.1/lib/cocoapods/command. RB: 48: In 'run'
From/library/Ruby/gems/2.0.0/gems/cocoapods-0.33.1/bin/pod: 33: In '<top (required)>'
From/usr/bin/pod: 23: In 'load'
From/usr/bin/pod: 23: In '<main> '"
After completing the preceding steps, perform the following operations:$ sudo gem install cocoapods
At this point, it is successful!
The rest is in the same project directory as before, create podfile, execute pod install, open xworkspace, etc !!!
Reference blog: http://www.cnblogs.com/cwgk/p/3370949.html
After OSX is upgraded to 10.10, use pod install to report the Final Solution