安装的那些基本方法不再赘述,请对坑填坑。
当pod install 时提示:
//K1
//K2 于是当你打算重装cocoapods的时候,提示需要高版本的ruby:
//方法:安装高版本ruby源
SharkTopdeiMac:~ sharktop$ curl -L get.rvm.io \ bash -s stable
#!/usr/bin/env bash
shopt -s extglob
set -o errtrace
set -o errexit
rvm_install_initialize()
{
DEFAULT_SOURCES=(github.com/rvm/rvm bitbucket.org/mpapis/rvm)
BASH_MIN_VERSION="3.2.25"
if
[[ -n "${BASH_VERSION:-}" &&
"$(\printf "%b" "${BASH_VERSION:-}\n${BASH_MIN_VERSION}\n" | LC_ALL=C \sort -t"." -k1,1n -k2,2n -k3,3n | \head -n1)" != "${BASH_MIN_VERSION}"
]]
then
echo "BASH ${BASH_MIN_VERSION} required (you have $BASH_VERSION)"
exit 1
fi
export HOME PS4
export rvm_trace_flag rvm_debug_flag rvm_user_install_flag rvm_ignore_rvmrc rvm_prefix rvm_path
PS4="+ \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
}
………………
rvm_install()
{
rvm_install_initialize
rvm_install_commands_setup
rvm_install_default_settings
rvm_install_parse_params "$@"
rvm_install_validate_rvm_path
rvm_install_select_and_get_version
rvm_install_main
rvm_install_ruby_and_gems
}
rvm_install "$@"
SharkTopdeiMac:~ sharktop$ command rvm install 2.3.0
//等待下载完成…
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.3.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/sharktop/.rvm/rubies/ruby-2.3.0, this may take a while depending on your cpu(s)...
ruby-2.3.0 - #downloading ruby-2.3.0, this may take a while depending on your connection...
** Resuming transfer from byte position 946176
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12.6M 100 12.6M 0 0 417k 0 0:00:30 0:00:30 --:--:-- 311k
ruby-2.3.0 - #extracting ruby-2.3.0 to /Users/sharktop/.rvm/src/ruby-2.3.0....
ruby-2.3.0 - #configuring......................................................|
ruby-2.3.0 - #post-configuration.
ruby-2.3.0 - #compiling........................................................|
ruby-2.3.0 - #installing.........
ruby-2.3.0 - #making binaries executable..
Installed rubygems 2.5.1 is newer than 2.4.8 provided with installed ruby, skipping installation, use --force to force installation.
ruby-2.3.0 - #gemset created /Users/sharktop/.rvm/gems/ruby-2.3.0@global
ruby-2.3.0 - #importing gemset /Users/sharktop/.rvm/gemsets/global.gems........|
ruby-2.3.0 - #generating global wrappers........
ruby-2.3.0 - #gemset created /Users/sharktop/.rvm/gems/ruby-2.3.0
ruby-2.3.0 - #importing gemsetfile /Users/sharktop/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.3.0 - #generating default wrappers........
ruby-2.3.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.3.0 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
/Users/sharktop/.rvm/bin/rvm: line 66: shell_session_update: command not found
//使用下载好的ruby版本作为默认ruby源
SharkTopdeiMac:~ sharktop$ rvm use 2.3.0 —-default
Using /Users/sharktop/.rvm/gems/ruby-2.3.0
SharkTopdeiMac:~ sharktop$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
SharkTopdeiMac:~ sharktop$ sudo gem install -n /usr/local/bin cocoapods
Password:
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed concurrent-ruby-1.0.2
Fetching: activesupport-5.0.0.1.gem (100%)
Successfully installed activesupport-5.0.0.1
Fetching: nap-1.1.0.gem (100%)
Successfully installed nap-1.1.0
Fetching: fuzzy_match-2.0.4.gem (100%)
//K3
SharkTopdeiMac:~ sharktop$sudo gem install -n /usr/local/bin cocoapods
ERROR: While executing gem ... (TypeError)
no implicit conversion of nil into String
//更新gem
SharkTopdeiMac:~ sharktop$ gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.6.6.gem (100%)
Successfully installed rubygems-update-2.6.6
Parsing documentation for rubygems-update-2.6.6
Installing ri documentation for rubygems-update-2.6.6
Installing darkfish documentation for rubygems-update-2.6.6
Done installing documentation for rubygems-update after 21 seconds
Parsing documentation for rubygems-update-2.6.6
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 2.6.6
RubyGems 2.6.6 installed
Parsing documentation for rubygems-2.6.6
Installing ri documentation for rubygems-2.6.6
=== 2.6.6 / 2016-06-22
Bug fixes:
* Sort installed versions to make sure we install the latest version when
running `gem update --system`. As a one-time fix, run
`gem update --system=2.6.6`. Pull request #1601 by David Radcliffe.
=== 2.6.5 / 2016-06-21
Minor enhancements:
* Support for unified Integer in Ruby 2.4. Pull request #1618
by SHIBATA Hiroshi.
* Update vendored Molinillo to 0.5.0 for performance improvements.
Pull request #1638 by Samuel Giddins.
Bug fixes:
* Raise an explicit error if Signer#sign is called with no certs. Pull
request #1605 by Daniel Berger.
* Update `update_bundled_ca_certificates` utility script for directory
nesting. Pull request #1583 by James Wen.
* Fix broken symlink support in tar writer (+ fix broken test). Pull
request #1578 by Cezary Baginski.
* Remove extension directory before (re-)installing. Pull request #1576
by Jeremy Hinegardner.
* Regenerate test CA certificates with appropriate extensions. Pull
request #1611 by rhenium.
* Rubygems does not terminate on failed file lock when not superuser. Pull
request #1582 by Ellen Marie Dash.
* Fix tar headers with a 101 character name. Pull request #1612 by Paweł
Tomulik.
* Add Gem.platform_defaults to allow implementations to override defaults.
Pull request #1644 by Charles Oliver Nutter.
* Run Bundler tests on TravisCI. Pull request #1650 by Samuel Giddins.
…………….
------------------------------------------------------------------------------
RubyGems installed the following executables:
/Users/sharktop/.rvm/rubies/ruby-2.3.0/bin/gem
Ruby Interactive (ri) documentation was installed. ri is kind of like man
pages for ruby libraries. You may access it like this:
ri Classname
ri Classname.class_method
ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.
RubyGems system software updated
SharkTopdeiMac:~ sharktop$sudo gem install -n /usr/local/bin cocoapods
Successfully installed fuzzy_match-2.0.4
Fetching: cocoapods-core-1.0.1.gem (100%)
Successfully installed cocoapods-core-1.0.1
Fetching: claide-1.0.0.gem (100%)
Successfully installed claide-1.0.0
Fetching: cocoapods-deintegrate-1.0.0.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.0
Fetching: cocoapods-downloader-1.1.0.gem (100%)
Successfully installed cocoapods-downloader-1.1.0
Fetching: cocoapods-plugins-1.0.0.gem (100%)
Successfully installed cocoapods-plugins-1.0.0
Fetching: cocoapods-search-1.0.0.gem (100%)
Successfully installed cocoapods-search-1.0.0
Fetching: cocoapods-stats-1.0.0.gem (100%)
Successfully installed cocoapods-stats-1.0.0
Fetching: netrc-0.7.8.gem (100%)
Successfully installed netrc-0.7.8
Fetching: cocoapods-trunk-1.0.0.gem (100%)
Successfully installed cocoapods-trunk-1.0.0
Fetching: cocoapods-try-1.1.0.gem (100%)
Successfully installed cocoapods-try-1.1.0
Fetching: molinillo-0.4.5.gem (100%)
Successfully installed molinillo-0.4.5
Fetching: colored-1.2.gem (100%)
Successfully installed colored-1.2
Fetching: xcodeproj-1.2.0.gem (100%)
Successfully installed xcodeproj-1.2.0
Fetching: escape-0.0.4.gem (100%)
Successfully installed escape-0.0.4
Fetching: fourflusher-0.3.2.gem (100%)
Successfully installed fourflusher-0.3.2
Fetching: cocoapods-1.0.1.gem (100%)
Successfully installed cocoapods-1.0.1
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for cocoapods-core-1.0.1
Installing ri documentation for cocoapods-core-1.0.1
Parsing documentation for claide-1.0.0
Installing ri documentation for claide-1.0.0
Parsing documentation for cocoapods-deintegrate-1.0.0
Installing ri documentation for cocoapods-deintegrate-1.0.0
Parsing documentation for cocoapods-downloader-1.1.0
Installing ri documentation for cocoapods-downloader-1.1.0
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-search-1.0.0
Installing ri documentation for cocoapods-search-1.0.0
Parsing documentation for cocoapods-stats-1.0.0
Installing ri documentation for cocoapods-stats-1.0.0
Parsing documentation for netrc-0.7.8
Installing ri documentation for netrc-0.7.8
Parsing documentation for cocoapods-trunk-1.0.0
Installing ri documentation for cocoapods-trunk-1.0.0
Parsing documentation for cocoapods-try-1.1.0
Installing ri documentation for cocoapods-try-1.1.0
Parsing documentation for molinillo-0.4.5
Installing ri documentation for molinillo-0.4.5
Parsing documentation for colored-1.2
Installing ri documentation for colored-1.2
Parsing documentation for xcodeproj-1.2.0
Installing ri documentation for xcodeproj-1.2.0
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for fourflusher-0.3.2
Installing ri documentation for fourflusher-0.3.2
Parsing documentation for cocoapods-1.0.1
Installing ri documentation for cocoapods-1.0.1
Done installing documentation for fuzzy_match, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-stats, netrc, cocoapods-trunk, cocoapods-try, molinillo, colored, xcodeproj, escape, fourflusher, cocoapods after 6 seconds
17 gems installed
//K4
SharkTopdeiMac:~ sharktop$ pod setup
Setting up CocoaPods master repo
[!] /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master
Cloning into 'master'...
error: RPC failed; curl 56 SSLRead() return error -36
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
SharkTopdeiMac:~ sharktop$ sudo gem uninstall cocoapods
SharkTopdeiMac:~ sharktop$ repo remove master
SharkTopdeiMac:~ sharktop$
SharkTopdeiMac:~ sharktop$ sudo gem install -n /usr/local/bin cocoapods
Password:
Successfully installed cocoapods-1.0.1
Parsing documentation for cocoapods-1.0.1
Done installing documentation for cocoapods after 1 seconds
1 gem installed
//此处过程缓慢,请耐心等待
SharkTopdeiMac:~ sharktop$ pod setup
Setting up CocoaPods master repo
CocoaPods 1.1.0.beta.1 is available.
To update use: `sudo gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.1.0.beta.1
Setup completed
//安装完成后查看当前版本
SharkTopdeiMac:~ sharktop$ pod --version
1.0.1
SharkTopdeiMac:~ sharktop$