雜談
這兩天,閑著赞弥,給自己找點事做。
看了Swift版的Pinlayout布局方式趣兄,了解了之前計算view和cell高度一直使用了錯誤的方法绽左,算是進步吧。
看了單元測試艇潭,終于明白了怎么用拼窥,都不知道是第幾次看了,以后總算是會用了蹋凝,也算是進步吧鲁纠。
看了一眼React Native,然后突發(fā)奇想鳍寂,用React Native重新寫一遍用oc和Swift混編的app會怎么樣改含,然后用Flutter也寫一遍,正好兩個都熟悉一下迄汛,說干就干捍壤。
理想是美好的,現(xiàn)實是殘酷的鞍爱,裝環(huán)境就搞了一天鹃觉。
開始
安裝依賴
安裝node
node在我上次用Sublime Text的時候安裝了,這里略過
安裝watchman
Watchman是由 Facebook 提供的監(jiān)視文件系統(tǒng)變更的工具睹逃。安裝此工具可以提高開發(fā)時的性能(packager 可以快速捕捉文件的變化從而實現(xiàn)實時刷新)盗扇。
DreamdeMac-mini:git Dream$ brew install watchman
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz
######################################################################### 100.0%
==> Pouring portable-ruby-2.6.3_2.yosemite.bottle.tar.gz
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
...
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python@3.8/3.8.3_1
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python@3.8/3.8.3
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
打印的東西太多,中間省略的好多,重點是最后報錯了疗隶,沒有權(quán)限躬柬,那就手動創(chuàng)建了,然后再分配權(quán)限
DreamdeMac-mini:git Dream$ sudo mkdir /usr/local/Frameworks
Password:
DreamdeMac-mini:git Dream$ sudo chown $(whoami):admin /usr/local/Frameworks/
再來抽减,這回成功了
DreamdeMac-mini:git Dream$ brew install watchman
Updating Homebrew...
fatal: unable to access 'https://github.com/Homebrew/brew/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
==> Downloading https://homebrew.bintray.com/bottles/watchman-4.9.0_4.catalina.b
Already downloaded: /Users/Dream/Library/Caches/Homebrew/downloads/e89d6c1565baa4d0503c6fe7f16e268f33459e2797971d5bb2ddde142fba0264--watchman-4.9.0_4.catalina.bottle.tar.gz
==> Pouring watchman-4.9.0_4.catalina.bottle.tar.gz
==> launchctl unload -F /Users/Dream/Library/LaunchAgents/com.github.facebook.wa
?? /usr/local/Cellar/watchman/4.9.0_4: 24 files, 2.1MB
DreamdeMac-mini:git Dream$ watchman -v
4.9.0
安裝yarn
Yarn是 Facebook 提供的替代 npm 的工具,可以加速 node 模塊的下載橄碾。
安裝完 yarn 之后就可以用 yarn
代替 npm
了卵沉,例如用yarn
代替npm install
命令,用yarn add xxx
代替npm install xxx
法牲。
DreamdeMac-mini:git Dream$ npm install -g yarn
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Dream/.npm/_logs/2020-07-09T03_00_20_693Z-debug.log
又是沒有權(quán)限史汗,分配權(quán)限,然后安裝
DreamdeMac-mini:git Dream$ sudo chown -R $USER /usr/local/lib/node_modules
Password:
DreamdeMac-mini:git Dream$ ls -l /usr/local/lib/node_modules
total 0
drwxr-xr-x 24 Dream wheel 768 6 3 00:03 npm
DreamdeMac-mini:git Dream$ npm install -g yarn
/usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js
/usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.22.4
added 1 package in 1.017s
安裝Xcode和cocoapods
已經(jīng)安裝了拒垃,這里也略過
新建React Native項目
環(huán)境安裝完了停撞,開始新建項目
DreamdeMac-mini:React_Native Dream$ npx react-native init AwesomeProject
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## ## ##
## ### ### ##
## ######################## ##
###### ### ### ######
### ## ## ## ## ###
### ## ### #### ### ## ###
## #### ######## #### ##
## ### ########## ### ##
## #### ######## #### ##
### ## ### #### ### ## ###
### ## ## ## ## ###
###### ### ### ######
## ######################## ##
## ### ### ##
## ## ## ##
## #### ##
## #### ##
## ### ### ##
### #### #### ###
###### ######
Welcome to React Native!
Learn once, write anywhere
? Downloading template
? Copying template
? Processing template
? Installing dependencies
? CocoaPods (https://cocoapods.org/) is not installed. CocoaPods is necessary for
the iOS project to run correctly. Do you want to install it? Yes, with gem (may
require sudo)
? Installing CocoaPods
error
? Installing CocoaPods
error Error: An error occured while trying to install CocoaPods, which is required by this template.
Please try again manually: sudo gem install cocoapods.
CocoaPods documentation: https://cocoapods.org/
提示我要裝cocoapods,這...悼瓮,都用了好幾年了戈毒,怎么還要裝。結(jié)果鬼使神差的執(zhí)行了安裝横堡,然后就出現(xiàn)了數(shù)不清的問題埋市。
先根據(jù)提示,用gem安裝cocoapods
DreamdeMac-mini:React_Native Dream$ sudo gem install cocoapods
Password:
Error loading RubyGems plugin "/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/executable-hooks-1.3.2/lib/rubygems_plugin.rb": dlopen(/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle
Reason: image not found - /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle (LoadError)
Error loading RubyGems plugin "/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/gems/2.3.0/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": dlopen(/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle
Reason: image not found - /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle (LoadError)
ERROR: Loading command: install (LoadError)
dlopen(/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle
Reason: image not found - /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/openssl.bundle
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
報錯命贴,然后嘗試用brew安裝cocoapods
DreamdeMac-mini:React_Native Dream$ brew install cocoapods
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
termcolor
==> Updated Formulae
ballerina onednn tomcat@7 websocat
==> Downloading https://homebrew.bintray.com/bottles/cocoapods-1.9.3.catalina.bot
==> Downloading from https://akamai.bintray.com/70/70f8c793bb60631422db028bbebb64
######################################################################## 100.0%
==> Pouring cocoapods-1.9.3.catalina.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/pod
Target /usr/local/bin/pod
already exists. You may want to remove it:
rm '/usr/local/bin/pod'
To force the link and overwrite all conflicting files:
brew link --overwrite cocoapods
To list all files that would be deleted:
brew link --overwrite --dry-run cocoapods
Possible conflicting files are:
/usr/local/bin/pod
/usr/local/bin/xcodeproj
==> Summary
?? /usr/local/Cellar/cocoapods/1.9.3: 12,523 files, 28.3MB
提示pod已存在道宅,選擇remove或者overwrite,我選了個overwrite
DreamdeMac-mini:React_Native Dream$ brew link --overwrite cocoapods
Linking /usr/local/Cellar/cocoapods/1.9.3... 2 symlinks created
然后順手查看了下pod版本
DreamdeMac-mini:React_Native Dream$ pod -v
/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (LoadError)
Referenced from: /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle
Reason: image not found - /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/digest/sha2.rb:14:in `<top (required)>'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/typhoeus-1.3.1/lib/typhoeus.rb:1:in `<top (required)>'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/lib/cocoapods/sources_manager.rb:5:in `<top (required)>'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/lib/cocoapods/core_overrides.rb:1:in `<top (required)>'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/lib/cocoapods.rb:75:in `<module:Pod>'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/lib/cocoapods.rb:17:in `<top (required)>'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/bin/pod:36:in `<top (required)>'
from /Users/Dream/.rvm/gems/ruby-2.3.0/bin/pod:22:in `load'
from /Users/Dream/.rvm/gems/ruby-2.3.0/bin/pod:22:in `<main>'
from /Users/Dream/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/Dream/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
這什么情況胸蛛,看這個錯誤和前面命令sudo gem install cocoapods
報錯都是ruby找不到了污茵,難道是剛才overwrite哪里出問題了,懵逼葬项。
不管了泞当,重新創(chuàng)建項目看下會不會有問題
DreamdeMac-mini:React_Native Dream$ npx react-native init AwesomeProject
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## ## ##
## ### ### ##
## ######################## ##
###### ### ### ######
### ## ## ## ## ###
### ## ### #### ### ## ###
## #### ######## #### ##
## ### ########## ### ##
## #### ######## #### ##
### ## ### #### ### ## ###
### ## ## ## ## ###
###### ### ### ######
## ######################## ##
## ### ### ##
## ## ## ##
## #### ##
## #### ##
## ### ### ##
### #### #### ###
###### ######
Welcome to React Native!
Learn once, write anywhere
error Cannot initialize new project because directory "AwesomeProject" already exists.
DreamdeMac-mini:React_Native Dream$ cd AwesomeProject/
DreamdeMac-mini:AwesomeProject Dream$ yarn ios
yarn run v1.22.4
$ react-native run-ios
error Could not find "Podfile.lock" at /Users/Dream/Desktop/React_Native/AwesomeProject/ios/Podfile.lock. Did you run "pod install" in iOS directory?
info Found Xcode project "AwesomeProject.xcodeproj"
info Launching iPhone 11 (iOS 13.5)
info Building (using "xcodebuild -project AwesomeProject.xcodeproj -configuration Debug -scheme AwesomeProject -destination id=FD02AE2D-EDEE-4672-9AE3-33F21586C0A4")
? Running script 'Start Packager'
? Compiling AppDelegate.m
? /Users/Dream/Desktop/React_Native/AwesomeProject/ios/AwesomeProject/AppDelegate.h:1:9: 'React/RCTBridgeDelegate.h' file not found
#import <React/RCTBridgeDelegate.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
? Compiling main.m
? /Users/Dream/Desktop/React_Native/AwesomeProject/ios/AwesomeProject/AppDelegate.h:1:9: 'React/RCTBridgeDelegate.h' file not found
#import <React/RCTBridgeDelegate.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
? Compiling AwesomeProject_vers.c
? Compiling LaunchScreen.storyboard
? Processing Info.plist
? Running script 'Bundle React Native code and images'
? Touching AwesomeProject.app (in target 'AwesomeProject' from project 'AwesomeProject')
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening AwesomeProject.xcodeproj. Run CLI with --verbose flag for more details.
我不知道是不是因為pod出問題了,沒有默認執(zhí)行pod install玷室,導(dǎo)致后面報錯一大堆零蓉。
進入創(chuàng)建的項目ios目錄下,執(zhí)行pod install
看看
DreamdeMac-mini:ios Dream$ pod install
/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': dlopen(/Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (LoadError)
Referenced from: /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle
Reason: image not found - /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/x86_64-darwin16/digest/sha2.bundle
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/digest/sha2.rb:14:in `'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/typhoeus-1.3.1/lib/typhoeus.rb:1:in `'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/lib/cocoapods/sources_manager.rb:5:in `'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/lib/cocoapods/core_overrides.rb:1:in `'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/lib/cocoapods.rb:75:in `'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/lib/cocoapods.rb:17:in `'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/Dream/.rvm/rubies/ruby-2.3.0/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /Users/Dream/.rvm/gems/ruby-2.3.0/gems/cocoapods-1.9.1/bin/pod:36:in `'
from /Users/Dream/.rvm/gems/ruby-2.3.0/bin/pod:22:in `load'
from /Users/Dream/.rvm/gems/ruby-2.3.0/bin/pod:22:in `'
from /Users/Dream/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/Dream/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `'
看這錯誤穷缤,還是是ruby版本不對敌蜂,好,卸載ruby津肛,重裝ruby章喉,過程是漫長的,在此過程中,我重新開了一個終端秸脱,進入到React Native創(chuàng)建的項目中落包,運行了pod install
命令,結(jié)果摊唇,結(jié)果沒報錯咐蝇,但是另外一邊,我已經(jīng)卸載ruby了巷查,還要重新安裝有序,我真是心疼崩了。
卸載ruby
簡單岛请,先查看當(dāng)前ruby 版本
DreamdeMac-mini:ios Dream$ ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16]
然后卸載
DreamdeMac-mini:ios Dream$ rvm uninstall ruby-2.3.0
ruby-2.3.0 - #removing src/ruby-2.3.0..
ruby-2.3.0 - #removing rubies/ruby-2.3.0.........................................-
Error running '__rvm_rm_rf /Users/Dream/.rvm/rubies/ruby-2.3.0',
please read /Users/Dream/.rvm/log/1594274115_ruby-2.3.0/remove.rubies.log
這都能報錯旭寿,強制卸載,
DreamdeMac-mini:ios Dream$ sudo rvm uninstall ruby-2.3.0
Password:
ruby-2.3.0 - #removing rubies/ruby-2.3.0..
ruby-2.3.0 - #removing default ruby interpreter..............
輸入密碼崇败,ok
重新安裝ruby
再看下ruby版本
DreamdeMac-mini:ios Dream$ ruby -v
-bash: /Users/Dream/.rvm/rubies/ruby-2.3.0/bin/ruby: No such file or directory
成功報錯盅称,說明可以安裝新版了,列出所有可用版本
DreamdeMac-mini:ios Dream$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.10]
[ruby-]2.3[.8]
[ruby-]2.4[.9]
[ruby-]2.5[.7]
[ruby-]2.6[.5]
[ruby-]2.7[.0]
ruby-head
選擇一個版本安裝后室,在這里的時候缩膝,腦子抽了,跑了下面一句
DreamdeMac-mini:ios Dream$ rvm install ruby 2.6.5
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
Installing requirements for osx_brew.
Updating system.......\
Xcode version older than 4.6.2 installed, download and install newer version from:
http://connect.apple.com
After installation open Xcode, go to Downloads and install Command Line Tools.
.
Error running 'requirements_osx_brew_update_system ruby-2.6.5',
please read /Users/Dream/.rvm/log/1594274623_ruby-2.6.5/update_system.log
Requirements installation failed with status: 1.
不出意外的咧擂,報錯了逞盆,找了半天,ruby和后面的版本號之間還有一個'-'松申,我看到了云芦,但是直接忽略了,懵逼贸桶,經(jīng)過一番嘗試(我不會說我又錯誤了很多次舅逸,而且還又裝了一遍Command Line Tools),成功開始安裝
DreamdeMac-mini:ios Dream$ rvm install ruby-2.6.5
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
Installing requirements for osx_brew.
Updating system...........Failed to update Homebrew, follow instructions at
https://docs.brew.sh/Common-Issues
and make sure `brew update` works before continuing.
.
Error running 'requirements_osx_brew_update_system ruby-2.6.5',
please read /Users/Dream/.rvm/log/1594275199_ruby-2.6.5/update_system.log
Requirements installation failed with status: 1.
好吧皇筛,先更新brew琉历,這回一下就運行完了
DreamdeMac-mini:ios Dream$ brew update
Updated 1 tap (homebrew/core).
==> Updated Formulae
fastlane ? batik teleport
azure-storage-cpp ser2net
再來安裝ruby
DreamdeMac-mini:ios Dream$ rvm install ruby-2.6.5
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.15/x86_64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
Installing requirements for osx_brew.
Updating system..........
Installing required packages: coreutils, zlib|
前面的一串和我輸入錯誤的時候,打印出來的東西一樣水醋,剛開始我還以為又要失敗了旗笔,結(jié)果好像沒有報錯,至少在我寫到這里的時候拄踪,還沒報錯蝇恶,慶幸吧。
轉(zhuǎn)過頭看pod install
怎么樣了惶桐,結(jié)果報錯了撮弧,嗯潘懊,報錯了。再來一遍唄贿衍,我習(xí)慣了授舟。
補充
ruby安裝成功了
DreamdeMac-mini:ios Dream$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]