杂谈
这两天,闲着,给自己找点事做。
看了Swift版的Pinlayout布局方式,了解了之前计算view和cell高度一直使用了错误的方法,算是进步吧。
看了单元测试,终于明白了怎么用,都不知道是第几次看了,以后总算是会用了,也算是进步吧。
看了一眼React Native,然后突发奇想,用React Native重新写一遍用oc和Swift混编的app会怎么样,然后用Flutter也写一遍,正好两个都熟悉一下,说干就干。
理想是美好的,现实是残酷的,装环境就搞了一天。
开始
安装依赖
安装node
node在我上次用Sublime Text的时候安装了,这里略过
安装watchman
Watchman是由 Facebook 提供的监视文件系统变更的工具。安装此工具可以提高开发时的性能(packager 可以快速捕捉文件的变化从而实现实时刷新)。
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
打印的东西太多,中间省略的好多,重点是最后报错了,没有权限,那就手动创建了,然后再分配权限
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
又是没有权限,分配权限,然后安装
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
已经安装了,这里也略过
新建React Native项目
环境安装完了,开始新建项目
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,这...,都用了好几年了,怎么还要装。结果鬼使神差的执行了安装,然后就出现了数不清的问题。
先根据提示,用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哪里出问题了,懵逼。
不管了,重新创建项目看下会不会有问题
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出问题了,没有默认执行pod install,导致后面报错一大堆。
进入创建的项目ios目录下,执行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创建的项目中,运行了pod install
命令,结果,结果没报错,但是另外一边,我已经卸载ruby了,还要重新安装,我真是心疼崩了。
卸载ruby
简单,先查看当前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和后面的版本号之间还有一个'-',我看到了,但是直接忽略了,懵逼,经过一番尝试(我不会说我又错误了很多次,而且还又装了一遍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|
前面的一串和我输入错误的时候,打印出来的东西一样,刚开始我还以为又要失败了,结果好像没有报错,至少在我写到这里的时候,还没报错,庆幸吧。
转过头看pod install
怎么样了,结果报错了,嗯,报错了。再来一遍呗,我习惯了。
补充
ruby安装成功了
DreamdeMac-mini:ios Dream$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]