✖ Installing Bundler error Error: Looks like your iOS environment is not properly set.
Environment
info Fetching system and libraries information...
System:
OS: macOS 13.0.1
CPU: (8) arm64 Apple M1
Memory: 161.55 MB / 8.00 GB
Shell: 3.2.57 - /bin/sh
Binaries:
Node: 18.12.1 - /usr/local/bin/node
Yarn: 1.22.11 - /usr/local/bin/yarn
npm: 9.4.2 - /usr/local/bin/npm
Watchman: 2023.01.23.00 - /usr/local/bin/watchman
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Description
Issue Occurring on MAC OS M1 chip - I am not the only one with this: I opened this issue here on the react-native GitHub and was told this is a bug and post it here by @cortinico
https://stackoverflow.com/questions/75040578/i-got-a-problem-installing-bundler-when-trying-create-my-new-react-native-projec
- except I have Xcode installed and I have other projects using expo which run perfectly with simulators etc etc
✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing Bundler
error Ignoring ffi-1.15.4 because its extensions are not built. Try: gem pristine ffi --version 1.15.4
Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2
✖ Installing Bundler
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
Error: Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
at createFromTemplate (/private/var/root/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/init/init.js:129:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.initialize [as func] (/private/var/root/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/init/init.js:181:3)
at async Command.handleAction (/private/var/root/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js:106:9)
info Run CLI with --verbose flag for more details.
Version
10.1.3
Reproducible Demo
npx react-native init newProject
Snack, code example, screenshot, or link to a repository

Looks like bundler installation failed for you. Could you try solution proposed here?
Looks like bundler installation failed for you. Could you try solution proposed here?
None work same issues occurring - been playing around with this for a while.
Hey @laurencebedford, I fixed a similar issue by changing my Ruby version to the proper one. Please ensure you have this version of Ruby. What I did:
- installed rbenv. Please make sure you copy and paste this line
eval "$(rbenv init - zsh)"at the end of the.zschrfile after installation. Optional: you might need to install Xcode dev tools, runxcode-select --installin terminal - install ruby version using the version manager above
- set it as global/local
Optional: the command above might not work if you have
.ruby-versionfile, delete file and try again - make sure you set it properly by running
rbenv versionsdocs - run
npx react-native@latest init AwesomeProject
I am having this issue on an Intel Mac. First timer following: https://reactnative.dev/docs/environment-setup
info Fetching system and libraries information...
System:
OS: macOS 12.6.1
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 196.89 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.13.2 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 8.6.0 - /usr/local/bin/npm
Watchman: 2023.03.06.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 29, 30, 31
Build Tools: 32.0.0
System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Intel x86 Atom_64, android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8512546
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_321 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.3 => 0.71.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
I had this issue too in an Intel Mac. Anyone know how to fix this?
我在 Intel Mac 上也遇到过这个问题。有人知道怎么修这个东西吗? 我也是,真无语,官方cli出问题,imac m1 出现一样的问题
Hey @laurencebedford, I fixed a similar issue by changing my Ruby version to the proper one. Please ensure you have this version of Ruby. What I did:
- installed rbenv. Please make sure you copy and paste this line
eval "$(rbenv init - zsh)"at the end of the.zschrfile after installation. Optional: you might need to install Xcode dev tools, runxcode-select --installin terminal- install ruby version using the version manager above
- set it as global/local Optional: the command above might not work if you have
.ruby-versionfile, delete file and try again- make sure you set it properly by running
rbenv versionsdocs- run
npx react-native@latest init AwesomeProject
Sorry it has been two week, this does not work.
我在 Intel Mac 上也遇到过这个问题。有人知道怎么修这个东西吗? 我也是,真无语,官方cli出问题,imac m1 出现一样的问题
Translation:
I also had this problem on an Intel Mac. Does anyone know how to fix this thing? Me too, really speechless, the official cli has a problem, and the imac m1 has the same problem
This is completely correct this issue is leaving M1 chip users screwed over currently.
It's 17th April. This issue is not fixed yet. I am still facing the issue.
hey @Visharada we'd appreciate some help from you on this one :)
I am also facing the same issue. I am tried lot's of solutions from both Github and StackOverFlow but nothing worked.
Am seeing a very similar issue on an M1 Macbook. I tried using ruby version 2.7.6 per @nazmeln's suggestion however when trying to run:
npx react-native init DetoxExample --template react-native-template-typescript
I get the error:
✔ Installing Bundler
✖ Installing CocoaPods dependencies (this may take a few minutes)
error warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
Error: Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
at createFromTemplate (/Users/jason/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/init/init.js:131:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.initialize [as func] (/Users/jason/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/init/init.js:184:3)
at async Command.handleAction (/Users/jason/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js:106:9)
info Run CLI with --verbose flag for more details.
Not sure if it's relevant, however in that stacktrace, the cocoapods gem seems to be vendored with ruby 2.7.0, not sure if that's introducing an incompatibility issue.
@jkotchoff Have you tried reinstalling the Ruby version using another version manager, like RVM? Hope it helps, also, don't forget to relaunch the terminal every time after changing Ruby version.
@jkotchoff Have you tried reinstalling the Ruby version using another version manager, like RVM? Hope it helps, also, don't forget to relaunch the terminal every time after changing Ruby version.
I use ASDF and am very familiar with Ruby, that's not the problem.
following script fix it for me
brew install libffi
ln -s $(brew --cellar libffi)/*/include/ffi.h /usr/local/include/ffi.h
ln -s $(brew --cellar libffi)/*/include/ffitarget.h /usr/local/include/ffitarget.h
referred to this thread: https://github.com/ffi/ffi/issues/814#issuecomment-677655537
following script fix it for me
brew install libffiln -s $(brew --cellar libffi)/*/include/ffi.h /usr/local/include/ffi.hln -s $(brew --cellar libffi)/*/include/ffitarget.h /usr/local/include/ffitarget.hreferred to this thread: ffi/ffi#814 (comment)
Solved my error thanks
This issue is not fixed yet. I am still facing the issue.
Node version : 16.15.1 ruby version: 2.6.10p210 xCode version : 14.1
following script fix it for me
brew install libffiln -s $(brew --cellar libffi)/*/include/ffi.h /usr/local/include/ffi.hln -s $(brew --cellar libffi)/*/include/ffitarget.h /usr/local/include/ffitarget.hreferred to this thread: ffi/ffi#814 (comment)
Still facing the same issue.
Still getting the same error :
`error Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/darimuhittin/Desktop/WORK/case_studies/ilker_aydin_case/GamesApp/vendor/bundle/ruby/2.7.0/gems/json-2.6.3/ext/json/ext/generator /Users/darimuhittin/.rbenv/versions/2.7.6/bin/ruby -I /Users/darimuhittin/.rbenv/versions/2.7.6/lib/ruby/2.7.0 -r ./siteconf20230530-51959-e4q9t5.rb extconf.rb creating Makefile
current directory: /Users/darimuhittin/Desktop/WORK/case_studies/ilker_aydin_case/GamesApp/vendor/bundle/ruby/2.7.0/gems/json-2.6.3/ext/json/ext/generator make "DESTDIR=" clean
current directory: /Users/darimuhittin/Desktop/WORK/case_studies/ilker_aydin_case/GamesApp/vendor/bundle/ruby/2.7.0/gems/json-2.6.3/ext/json/ext/generator make "DESTDIR=" compiling generator.c linking shared-object json/ext/generator.bundle ld: building for iOS Simulator, but linking in dylib built for macOS, file '/Users/darimuhittin/.rbenv/versions/2.7.6/lib/libruby.2.7.dylib' for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [generator.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/darimuhittin/Desktop/WORK/case_studies/ilker_aydin_case/GamesApp/vendor/bundle/ruby/2.7.0/gems/json-2.6.3 for inspection. Results logged to /Users/darimuhittin/Desktop/WORK/case_studies/ilker_aydin_case/GamesApp/vendor/bundle/ruby/2.7.0/extensions/arm64-darwin-22/2.7.0/json-2.6.3/gem_make.out
An error occurred while installing json (2.6.3), and Bundler cannot continue.
Make sure that gem install json -v '2.6.3' --source 'https://rubygems.org/'
succeeds before bundling.
In Gemfile: cocoapods was resolved to 1.12.1, which depends on cocoapods-core was resolved to 1.12.1, which depends on algoliasearch was resolved to 1.27.5, which depends on json
✖ Installing Bundler error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS. Error: Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS. at createFromTemplate (/Users/darimuhittin/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/commands/init/init.js:131:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.initialize [as func] (/Users/darimuhittin/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/commands/init/init.js:184:3) at async Command.handleAction (/Users/darimuhittin/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/index.js:106:9) info Run CLI with --verbose flag for more details.`
anyone can help with this ?
I have the same issue in M2 chip, anyone help? i cant create new projects..
Here is my solution.
I encounter this error as well although have probably set appropriate ruby version using rbenv.
Turn out the error comes from dependency installations with pod install. The error did not displayed at all with the init project command.
You guys can try cd to the project/ios and perform pod install to see if there is any error here and follow the instructions in the error messages. For me it just to do pod install --repo-update manually 🎉
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
The error still exists
@laurencebedford I have the same error with you.How can I resolve it ?
Same error on my side, with M1.
I have the exact same issue using M1
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.
I have the exact same issue using Mac Intel
There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.