网站建设 之 react-native pod install

时间:2024-04-08 21:33:52

当前ruby:3.3.0,pod是基于rudy安装的

pod 直接报错,安装一下:

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

npm run dev:ios出错了

error: called object type 'facebook::flipper::SocketEventHandler' (aka 'int') is not a function or function pointer

竟然用这个彻底解决了:

[Fixed & Shipped in latest releases] Upgrading Xcode to 15.3 results in build error - `Called object type 'facebook::flipper::SocketCertificateProvider' (aka 'int') is not a function or function pointer` · Issue #43335 · facebook/react-native · GitHub

Unable to process request - PLA Update available

You currently don't have access to this membership resource. To resolve this issue, agree to the latest Program License Agreement in your developer account.

嗯嗯

安装pod需要ruby环境

rvm常用:

$ rvm list known
$ rvm install 1.9.2 # 安装 ruby-1.9.2
$ rvm install ree # install Ruby Enterprise Edition (REE)

$ rvm ruby-1.8.7-p160 #切换1.8.7-p160为当前使用版本
$ rvm 1.8.7-p160 #同上面命令一样rvm ruby-1.8.7-p160
$ ruby -v #查看当前Ruby版本

$ rvm reset #恢复系统默认设置

$ rvm remove ruby-1.9.2-p0

指定ruby

rvm use 3.0.0 --default

现在的问题是,npm run pod-install 会报错:

/usr/local/Cellar/ruby/3.3.0/lib/ruby/3.3.0/rubygems.rb:259:in
 `find_spec_for_exe': can't find gem cocoapods (>= 0.a) 
with executable pod (Gem::GemNotFoundException)
        from /usr/local/Cellar/ruby/3.3.0/lib/ruby/3.3.0/rubygems.rb:278:in `activate_bin_path'
        from /usr/local/bin/pod:25:in `<main>'
        from /usr/local/bin/ruby_executable_hooks:22:in `eval'
        from /usr/local/bin/ruby_executable_hooks:22:in `<main>'

查了一下,什么意思呢?发现不了pod?我先更新一下:

sudo gem update -n /usr/local/bin --system
现在是3.3.0,但是rvm list known最高是3.0.0,是不是这个问题?那么必然是3.0.0,安装一下3.3.0,应该注意openssl:

rvm install 3.0.0 -n /usr/local/bin --with-openssl-dir=/usr/local/Cellar/openssl@1.1

注意网络连接需要正常

出现问题了:

Error running '__rvm_make -j8',
please read /Users/heroisuseless/.rvm/log/1712046884_ruby-3.0.0/make.log

一般是openssl的原因

rvm install 3.0.0 --with-gcc=clang  --with-openssl-dir=/usr/local/Cellar/openssl@1.1