在自己的電腦上安裝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 系統(tǒng)的
之后運行 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
之后 持續(xù) 高潮
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 然后按照 以上方法重新再來一次