前序装置步骤参阅这个文章即可,简单明了。 # CocoaPods装置办法-2023.09.15

我讲几个我装置过程中遇到的问题:

不论报什么过错,先去严厉查看这三个东西装置好没有!!!

不论报什么过错,先去严厉查看这三个东西装置好没有!!!

不论报什么过错,先去严厉查看这三个东西装置好没有!!!

1Xcode
2、Command Line Tools for Xcode
3、Homebrew 

或许的报错状况:

1、履行➜ rvm install ruby-3.2.2 报错了。。。

a.首要保证homebrew updatehomebrew doctor 都成功了,履行提示这个了Your system is ready to brew.,没有就在回去装置.

另外最新homebrew 装置完了还要履行两个指令:

echo "eval $(/opt/homebrew/bin/brew shellenv)" >> ~/.zprofile
eval $(/opt/homebrew/bin/brew shellenv)

b.去xcode -> setting-> locations查看看Command Line Tools有没有装置,途径对不对!!

前面都没问题了,假如还报过错,或许的过错信息如下。

报错相似如下:Error running '__rvm_make -j8' 或者openssl 过错

Searching for binary rubies, this might take some time.
DNo binary rubies available for: osx/14.0/arm64/ruby-3.2.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/opt/homebrew/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/eddie/.rvm/rubies/ruby-3.2.2, this may take a while depending on your cpu(s)...
ruby-3.2.2 - #downloading ruby-3.2.2, this may take a while depending on your connection...
ruby-3.2.2 - #extracting ruby-3.2.2 to /Users/eddie/.rvm/src/ruby-3.2.2 - please wait
ruby-3.2.2 - #configuring - please wait
ruby-3.2.2 - #post-configuration - please wait
ruby-3.2.2 - #compiling - please wait
Error running '__rvm_make -j8',
please read /Users/eddie/.rvm/log/1696846129_ruby-3.2.2/make.log
There has been an error while running make. Halting the installation.
履行以下指令修复:
rvm reinstall 3.2.2 --with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml) --disable-dtrace --disable-docs
2、都装置成功后,履行pod 指令时报错相似:
undefined method `deprecator' for ActiveSupport:Module ( **NoMethodError** )

/Users/eddie/.rvm/rubies/ruby-3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.0/lib/active_support/core_ext/array/conversions.rb:108:in <class:Array>': **undefined method deprecator’ for ActiveSupport:Module (** NoMethodError )

deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator

Did you mean? deprecate_constant

解决办法:

我这里运用的是1.13.0 pod版别!!!

先履行指令:

sudo gem uninstall activesupport

提示:

You have requested to uninstall the gem:
activesupport-7.1.0
cocoapods-core-1.13.0 depends on activesupport (>= 5.0, < 8)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Successfully uninstalled activesupport-7.1.0

然后再履行这个指令:

sudo gem install activesupport -v 7.0.8

提示:


Successfully installed activesupport-7.0.8
Parsing documentation for activesupport-7.0.8
Installing ri documentation for activesupport-7.0.8
Done installing documentation for activesupport after 0 seconds
1 gem installed

在试试pod 指令应该就可以了。。。

PS:暂时就记住这几个问题了,其他想起来再弥补。 Ruby一定要装置最新版别哈。
晋级xcode到15或许呈现的过错

呈现一堆libc++ abi的过错,跑不起来.
解决办法:
other linker flags里边添加-ld64

呈现:SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a'; try increasing the minimum deployment target

解决办法:

按阐明,去添加对应库的iOS Deployment Target 版别号,现在最低都在iOS12以上了吧,不是的请求往高调吧,低了没用,还麻烦