下面是自己在安装遇到一些问题及解决方法,比较凌乱无序,提供大家参考下吧
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安装环境
curl -L https://get.rvm.io | bash -s stable
载入rvm环境
source ~/.rvm/scripts/rvm
安装完成后,重复上述检查操作
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
完成后继续执行:
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
下面是关于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
执行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