CLI doesn't detect Cococapods installed via rbenv.
See original GitHub issueEnvironment
> rbenv --version
rbenv 1.2.0
> ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin21]
> pod --version
1.11.3
> which pod
/Users/christopher.araujo/.rbenv/shims/pod
> node --version
v16.16.0
Description
The React Native CLI does not seem to detect Cocoapods installed via RubyGems managed by rbenv. The CLI prompts me to install Cocoapods. However, selecting Yes, with gem (may require sudo)
throws an error.
✔ CocoaPods (https://cocoapods.org/) is not installed. CocoaPods is necessary for the iOS project to run correctly. Do you want to install it? › Yes, with gem (may require sudo)
✖ Installing CocoaPods
error
✖ Installing CocoaPods
error Error: An error occured while trying to install CocoaPods, which is required by this template.
Please try again manually: sudo gem install cocoapods.
Reproducible Demo
Run npx react-native init MyFirstRNProject
on a machine that has Cocoapods installed via RubyGems managed by rbenv.
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:20 (4 by maintainers)
Top Results From Across the Web
CocoaPods not installed or not in valid state - Stack Overflow
CocoaPods not installed or not in valid state · 1. have you tried to run the command from the error message sudo gem...
Read more >issue with cocoapods installation | Apple Developer Forums
this works for me: Step 1 (install HomeBrew). /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh).
Read more >How to address problems with Ruby, cocoapods and react ...
It throws an error when trying to install the iOS dependencies because cocoapod needs Ruby to work properly. Ruby doesn't work properly from...
Read more >cocoapods is installed but broken. skipping pod install.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it....
Read more >How to Install Ruby on a Mac with chruby, rbenv, or RVM
You can install chruby and ruby-install using Homebrew. ... may take some time. rbenv doesn't have a command to switch to a Ruby...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
also having this problem. already have cocoapods installed on version of ruby that is set via rbenv. m1 mac. running
sudo gem install cocoapods
does not help.I just gave up installing my project with RN version 0.70. Impossible to install Bundler because of the Ruby version, impossible to make any Ruby version manager work