M1处理器 cocoapods pod install 等命令报错问题

错误信息:
Users/xxxxx/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/ffi-1.15.5/lib

Error (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

dlopen(/Library/Ruby/Gems/2.6.0/gems/bigdecimal-1.4.4/lib/bigdecimal.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/bigdecimal-1.4.4/lib/bigdecimal.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Library/Ruby/Gems/2.6.0/gems/bigdecimal-1.4.4/lib/bigdecimal.bundle (LoadError)


更新Homebrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

source /Users/xxxxxx/.bash_profile

安装 rvm
curl -L get.rvm.io | bash -s stable  
source ~/.bashrc 
source ~/.bash_profile 

更新 ruby 到最新版
rvm list known 
rvm install 3.0.0
source ~/.rvm/scripts/rvm
rvm --default use 3.0.0
ruby -v

(更新 Gem  :  sudo gem update -n /usr/local/bin —system )

更新 cocoapods
sudo gem install -n /usr/local/bin cocoapods

cd 到项目

pod install

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容