在自己的电脑上安装cocoapods的时候遇见以下问题,以前从来没见过
Password:
Fetching: nap-1.1.0.gem (100%)
Successfully installed nap-1.1.0
Fetching: fourflusher-0.3.2.gem (100%)
Successfully installed fourflusher-0.3.2
Fetching: escape-0.0.4.gem (100%)
Successfully installed escape-0.0.4
Fetching: colored-1.2.gem (100%)
Successfully installed colored-1.2
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed concurrent-ruby-1.0.2
Fetching: minitest-5.9.0.gem (100%)
Successfully installed minitest-5.9.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: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: activesupport-5.0.0.1.gem (100%)
ERROR: Error installing cocoapods:
activesupport requires Ruby version >= 2.2.2.'```
在网络上查询了以后 说是ruby 版本问题太低了就去尝试更新最新的的ruby,但是在电脑上安装最新的ruby 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/Steven/.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 2711552
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10.9M 100 10.9M 0 0 9048 0 0:21:08 0:21:08 --:--:-- 31509
ruby-2.3.0 - #extracting ruby-2.3.0 to /Users/Steven/.rvm/src/ruby-2.3.0....
ruby-2.3.0 - #configuring......................................................|
ruby-2.3.0 - #post-configuration.
ruby-2.3.0 - #compiling...........
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/Steven/.rvm/log/1476157311_ruby-2.3.0/make.log
compiling ./missing/explicit_bzero.c
compiling ./missing/setproctitle.c
compiling dmyenc.c
linking miniruby
config.status: creating ruby-runner.c
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
Referenced from: /Users/Steven/.rvm/src/ruby-2.3.0/./miniruby (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _clock_gettime
Referenced from: /Users/Steven/.rvm/src/ruby-2.3.0/./miniruby (which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
make: *** [.rbconfig.time] Trace/BPT trap: 5
++ return 2
There has been an error while running make. Halting the installation.```
有两个错误,在这里我要提醒各位不要去找这个错误的原因,因为我在这个坑里爬了很久都没爬出来我一直在找这个ruby无法更新的问题最后在StackFlower 上看见作者说是一个bug 没法找到长时间维护此项目的coder所以没有解决这个问题,所以这个问题我个人认为是还没法解决的。我在stackflower 上找到今天凌晨3点都没有找到这个问题的解决方案。
之后我转换思路,从解决 activesupport requires Ruby version >= 2.2.2.' 这个问题入手 我把Xcode 卸载了 重新装了一遍 在stack flower 找到的这句神奇的代码
sudo gem install activesupport -v 4.2.6
就没有问题了 我 没有更新 ruby 还是用的 2.0.0 系统的
之后运行 sudo gem install cocoa pods
瞬间让你G点的时刻就来了
StevendeMacBook-Pro:~ Steven$ sudo gem install cocoapods
Fetching: claide-1.0.0.gem (100%)
Successfully installed claide-1.0.0
Fetching: xcodeproj-1.3.0.gem (100%)
Successfully installed xcodeproj-1.3.0
Fetching: molinillo-0.4.5.gem (100%)
Successfully installed molinillo-0.4.5
Fetching: cocoapods-try-1.1.0.gem (100%)
Successfully installed cocoapods-try-1.1.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-stats-1.0.0.gem (100%)
Successfully installed cocoapods-stats-1.0.0
Fetching: cocoapods-search-1.0.0.gem (100%)
Successfully installed cocoapods-search-1.0.0
Fetching: cocoapods-plugins-1.0.0.gem (100%)
Successfully installed cocoapods-plugins-1.0.0
Fetching: cocoapods-downloader-1.1.1.gem (100%)
Successfully installed cocoapods-downloader-1.1.1
Fetching: cocoapods-deintegrate-1.0.1.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.1
Fetching: fuzzy_match-2.0.4.gem (100%)
Successfully installed fuzzy_match-2.0.4
Fetching: cocoapods-core-1.0.1.gem (100%)
Successfully installed cocoapods-core-1.0.1
Fetching: cocoapods-1.0.1.gem (100%)
Successfully installed cocoapods-1.0.1
Parsing documentation for claide-1.0.0
Installing ri documentation for claide-1.0.0
Parsing documentation for xcodeproj-1.3.0
Installing ri documentation for xcodeproj-1.3.0
Parsing documentation for molinillo-0.4.5
Installing ri documentation for molinillo-0.4.5
Parsing documentation for cocoapods-try-1.1.0
Installing ri documentation for cocoapods-try-1.1.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-stats-1.0.0
Installing ri documentation for cocoapods-stats-1.0.0
Parsing documentation for cocoapods-search-1.0.0
Installing ri documentation for cocoapods-search-1.0.0
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-downloader-1.1.1
Installing ri documentation for cocoapods-downloader-1.1.1
Parsing documentation for cocoapods-deintegrate-1.0.1
Installing ri documentation for cocoapods-deintegrate-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 cocoapods-1.0.1
Installing ri documentation for cocoapods-1.0.1
14 gems installed
之后 持续 高潮
StevendeMacBook-Pro:~ Steven$ pod setup
Setting up CocoaPods master repo
$ /usr/bin/git pull --ff-only
From https://github.com/CocoaPods/Specs
a05e8fc..49a15c7 master -> origin/master
Updating a05e8fc..49a15c7
Fast-forward
Specs/Cerfing/2.0.4/Cerfing.podspec.json | 42 +++++++++++++++++++
Specs/CivicSDK/0.1.2/CivicSDK.podspec.json | 27 ++++++++++++
Specs/CivicSDK/0.1.21/CivicSDK.podspec.json | 27 ++++++++++++
.../1.0.2/CodeCoverageForXcode8GM.podspec.json | 22 ++++++++++
Specs/CoreDragon/0.1.3/CoreDragon.podspec.json | 40 ++++++++++++++++++
Specs/DHAnimation/0.1.0/DHAnimation.podspec.json | 22 ++++++++++
Specs/DUMessaging/2.0.1/DUMessaging.podspec.json | 37 +++++++++++++++++
Specs/EzHTTP/3.0.9/EzHTTP.podspec.json | 23 +++++++++++
.../EzImageLoader/3.0.5/EzImageLoader.podspec.json | 32 +++++++++++++++
.../0.0.3/FEPopupMenuController.podspec.json | 27 ++++++++++++
Specs/HanekeObjc/0.13.0/HanekeObjc.podspec.json | 25 +++++++++++
.../0.2.1/InAppTranslation.podspec.json | 21 ++++++++++
.../0.2.2/InAppTranslation.podspec.json | 21 ++++++++++
.../1.0.7/JCNavigationController.podspec.json | 24 +++++++++++
.../JRBaseRequest/1.0.1/JRBaseRequest.podspec.json | 22 ++++++++++
.../JRBaseRequest/1.0.2/JRBaseRequest.podspec.json | 22 ++++++++++
Specs/LSNetworking/0.2.5/LSNetworking.podspec.json | 22 ++++++++++
.../LSProgressHUD/0.2.1/LSProgressHUD.podspec.json | 35 ++++++++++++++++
.../0.2.0/OptionalEquatable.podspec.json | 23 +++++++++++
.../0.14.0/ReactiveCache.podspec.json | 28 +++++++++++++
Specs/SJUtils/0.0.3/SJUtils.podspec.json | 26 ++++++++++++
Specs/SJUtils/0.0.4/SJUtils.podspec.json | 29 +++++++++++++
.../0.3.2/SWCardViewController.podspec.json | 22 ++++++++++
Specs/SenStickSDK/0.9.0/SenStickSDK.podspec.json | 28 +++++++++++++
Specs/SenStickSDK/0.9.1/SenStickSDK.podspec.json | 28 +++++++++++++
.../1.6.18/SensorsAnalyticsSDK.podspec.json | 37 +++++++++++++++++
.../TTFloatButton/0.1.2/TTFloatButton.podspec.json | 22 ++++++++++
Specs/TTLog/0.1.4/TTLog.podspec.json | 22 ++++++++++
Specs/XLsn0w/5.0.0/XLsn0w.podspec.json | 48 ++++++++++++++++++++++
29 files changed, 804 insertions(+)
create mode 100644 Specs/Cerfing/2.0.4/Cerfing.podspec.json
create mode 100644 Specs/CivicSDK/0.1.2/CivicSDK.podspec.json
create mode 100644 Specs/CivicSDK/0.1.21/CivicSDK.podspec.json
create mode 100644 Specs/CodeCoverageForXcode8GM/1.0.2/CodeCoverageForXcode8GM.podspec.json
create mode 100644 Specs/CoreDragon/0.1.3/CoreDragon.podspec.json
create mode 100644 Specs/DHAnimation/0.1.0/DHAnimation.podspec.json
create mode 100644 Specs/DUMessaging/2.0.1/DUMessaging.podspec.json
create mode 100644 Specs/EzHTTP/3.0.9/EzHTTP.podspec.json
create mode 100644 Specs/EzImageLoader/3.0.5/EzImageLoader.podspec.json
create mode 100644 Specs/FEPopupMenuController/0.0.3/FEPopupMenuController.podspec.json
create mode 100644 Specs/HanekeObjc/0.13.0/HanekeObjc.podspec.json
create mode 100644 Specs/InAppTranslation/0.2.1/InAppTranslation.podspec.json
create mode 100644 Specs/InAppTranslation/0.2.2/InAppTranslation.podspec.json
create mode 100644 Specs/JCNavigationController/1.0.7/JCNavigationController.podspec.json
create mode 100644 Specs/JRBaseRequest/1.0.1/JRBaseRequest.podspec.json
create mode 100644 Specs/JRBaseRequest/1.0.2/JRBaseRequest.podspec.json
create mode 100644 Specs/LSNetworking/0.2.5/LSNetworking.podspec.json
create mode 100644 Specs/LSProgressHUD/0.2.1/LSProgressHUD.podspec.json
create mode 100644 Specs/OptionalEquatable/0.2.0/OptionalEquatable.podspec.json
create mode 100644 Specs/ReactiveCache/0.14.0/ReactiveCache.podspec.json
create mode 100644 Specs/SJUtils/0.0.3/SJUtils.podspec.json
create mode 100644 Specs/SJUtils/0.0.4/SJUtils.podspec.json
create mode 100644 Specs/SWCardViewController/0.3.2/SWCardViewController.podspec.json
create mode 100644 Specs/SenStickSDK/0.9.0/SenStickSDK.podspec.json
create mode 100644 Specs/SenStickSDK/0.9.1/SenStickSDK.podspec.json
create mode 100644 Specs/SensorsAnalyticsSDK/1.6.18/SensorsAnalyticsSDK.podspec.json
create mode 100644 Specs/TTFloatButton/0.1.2/TTFloatButton.podspec.json
create mode 100644 Specs/TTLog/0.1.4/TTLog.podspec.json
create mode 100644 Specs/XLsn0w/5.0.0/XLsn0w.podspec.json
CocoaPods 1.1.0.rc.2 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.rc.2
Setup completed
大家遇见这个问题以后 千万不要去踩到 ruby 的版本更新的 问题里面去 因为这个问题解决不了 还浪费时间。
不行的话就卸载Xcode 然后按照 以上方法重新再来一次