下面是自己在安裝遇到一些問題及解決方法,比較凌亂無序,提供大家參考下吧
1挽鞠、安裝 cocoapods:
sudo gem install -n /usr/local/bin cocoapods
問題1:
ERROR: Error installing cocoapods:
ERROR: Failed to build gem native extension.
解決:
curl -L https://get.rvm.io | bash -s stable
檢查rvm安裝環(huán)境
curl -L https://get.rvm.io | bash -s stable
載入rvm環(huán)境
source ~/.rvm/scripts/rvm
安裝完成后媚赖,重復(fù)上述檢查操作
rvm -v
問題2:
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
解決:
更新homebrew
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"
問題3:
homebrew-core is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
解決:
cd /usr/local/Homebrew/Library/Taps/homebrew
rm -rf homebrew-core
brew upgrade
完成后繼續(xù)執(zhí)行:
sudo gem install -n /usr/local/bin cocoapods
問題4:
xcode-select: error: command line tools are already installed, use "Software Update" to install
解決:
sudo? rm -rf /Library/Developer/CommandLineTools
sudo? xcode-select --install
2、使用RVM升級Ruby
ruby -v
rvm list known
rvm install 版本號
問題1:
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.6',
please read /Users/huangzhiwu/.rvm/log/1617024849_ruby-2.6.6/update_system.log
Requirements installation failed with status: 1.
解決:
rvm autolibs read-only
rvm install ruby-2.6.5
ruby -v
問題2:
Error running 'env GEM_HOME=/Users/huangzhiwu/.rvm/gems/ruby-2.6.5@global GEM_PATH= /Users/huangzhiwu/.rvm/rubies/ruby-2.6.5/bin/ruby -d /Users/huangzhiwu/.rvm/src/rubygems-3.0.9/setup.rb --no-document',
please read /Users/huangzhiwu/.rvm/log/1617025525_ruby-2.6.5/rubygems.install.log
解決:
$?rvm?remove?ruby-*.*.*-p*??????????#?get?rid?of?unsuccessful?installation
$?rvm?get?head?--autolibs=3?????????#?get?the?latest?RVM?and?build?required?libs
$?rvm?requirements??????????????????#?just?in?case,?install?all?other?required?stuff
$?rvm?install?ruby-*.*.*-p*?????????#?reinstall?this?ruby
$?rvm?--default?use?ruby-*.*.*-p*
更新:gem
sudo gem c
pod進度
pod install --verbose --no-repo-update
問題:pod install
/Library/Ruby/Site/2.3.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)
from /Library/Ruby/Site/2.3.0/rubygems.rb:299:in `activate_bin_path'
from /usr/local/bin/pod:23:in `<main>'
解決:
gem install cocoapods
下面是關(guān)于flutter:
export PATH=/Users/huangzhiwu/Desktop/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
command not found: flutter
在命令行輸入 sudo vi ~/.bash_profile幔崖,然后在里面按i添加
export PATH=/Users/huangzhiwu/Desktop/flutter/bin:$PATH
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
按ESC鍵食店,輸入:wq
執(zhí)行source ~/.bash_profile,這一步很重要赏寇,否則上面配置文件雖然有了吉嫩,但是沒有生效
問題:
Flutter ios/Flutter/Debug.xcconfig: unable to open file (in target "Runner" in project "Runner")
解決:
1?cd 項目目錄
flutter clean
flutter create --org solanddriver .
運行Xcode