question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI doesn't detect Cococapods installed via rbenv.

See original GitHub issue

Environment

> 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:closed
  • Created a year ago
  • Reactions:5
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
heyalexchoicommented, Jul 13, 2022

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.

2reactions
rdhoxcommented, Oct 31, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found