0
  • I am trying to create a new React Native Project using npx. The whole npx process is getting failed due to Ruby version. Check the attached image for more details.
  • The Ruby version was already updated using rbenv. You can see the Ruby version in the image attached.
  • I have also added the necessary code to the .bash_profile and .zshrc files. Restarted the terminal and system multiple times but the error is the same.

I don't understand what I'm doing wrong.

Terminal Image

Vishal Lohar
  • 51
  • 1
  • 5

1 Answers1

0

First use rbenv for the ruby setup. I'll recommend to restart the system once done with the ruby setup. take help from here.

Then follow these steps to create the react native project.

1. npx react-native init testproject --skip-install

2. cd testproject

3. yarn install

4. cd ios

5. bundle install (For Intel Chip)
   arch -arm64 bundle install (For M1 Chip)

6. bundle exec pod install (For Intel Chip)
   arch -arm64 bundle exec pod install (For M1 Chip)
Kailash
  • 777
  • 4
  • 19
  • This works! But I now have other issues like "We ran "xcodebuild" command but it exited with error code 65". I tried some Stackoverflow solutions but nothing changed. – Vishal Lohar Nov 29 '22 at 15:36
  • If it works this way then what's the problem when directly installed using npx. Ruby version is updated and rbenv is installed correctly. – Vishal Lohar Nov 29 '22 at 15:37