如何解决如何使用 Rosetta 在 Mac 上解决“react-native”和 cocopods 的错误
我正在尝试在带有应用程序芯片的新 Mac 计算机上执行 React Native 项目。 按照某些论坛的建议将终端更改为使用 Rosetta 打开
安装了cocoa pods 1.10.1 版本 使用 NPM 14.16.0 和 React Native 版本 0.63.4 和 Xcode 版本 12.4 并尝试在 iOS 文件夹中运行 pod install 命令。我收到以下错误。
[!] An error occurred while processing the post-install hook of the Podfile.
undefined method `react_native_post_install' for #<Pod::Podfile:0x00000001572d90f8>
/Users/vvvvv/WebstormProjects/Reer/ios/Podfile:27:in `block (3 levels) in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.1/lib/cocoapods-core/podfile.rb:179:in `post_install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:897:in `run_podfile_post_install_hook'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:885:in `block in run_podfile_post_install_hooks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:145:in `message'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:884:in `run_podfile_post_install_hooks'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:329:in `block (2 levels) in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in `write!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:328:in `block in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:307:in `create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:299:in `generate_pods_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:178:in `integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:166:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
感谢任何帮助。
解决方法
react_native_post_install
在 "react-native": "0.64.0",
中。
我经历了将我的博览会创建的项目转移到原始 react-native 的经历。
对我来说,我使用的是 "react-native": "~0.63.4",
,但从 0.64 新版本的 reactive-native init
中复制了 Podfile。
我遇到了同样的问题,在我的情况下,我使用以下链接修复了问题。
https://pezant.ca/blog/readlink-command-not-found/
It is happens when you just copy the line (below) into the .bash_profile without removing the quotes (‘xxxx’)
export PATH=’/usr/local/bin:$PATH’
To resolve,just run in console:
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
Then,edit again the file removing the quotes:
vim ~/.bash_profile
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。