pod install failed on macOS Big sur - react-native
I am pretty new to macOS and recently shift to macOS from windows, I started to working on react-native app and when I try react-native run-ios it gives me below error
error Could not find "Podfile.lock" at /Users/saniranimantha/Documents/Learning/albums/ios/Podfile.lock. Did you run "pod install" in iOS directory?
info Found Xcode project "albums.xcodeproj"
info Launching iPhone 11 (iOS 14.3)
info Building (using "xcodebuild -project albums.xcodeproj -configuration Debug -scheme albums -destination id=FE71292F-36FA-4226-A8E5-B4EF4E8B625D")
(node:726) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening albums.xcodeproj. Run CLI with --verbose flag for more details.
when I search for the reason to this error, I found out that I need to run pod install command, when I try that, it gives me another error. I tried several suggestions from stack-overflow & git, but still no luck. I did install cocoapod. I searched for a similar issue, but couldn't find anything. That's why I decided to post it here for an answer. if anyone can help me here, that would be really great.
my OS is macOS Big Sur (v11.1)
this is my podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'albums' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
target 'albumsTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'albums-tvOS' do
# Pods for albums-tvOS
target 'albums-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
this is the error I get on pod install
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
### Command
```
/usr/local/bin/pod install
```
### Report
* What did you do?
* What did you expect to happen?
* What happened instead?
### Stack
```
CocoaPods : 1.10.0
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
RubyGems : 3.0.3
Host : macOS 11.1 (20C69)
Xcode : 12.3 (12C33)
Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories :
```
### Plugins
```
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-trunk : 1.5.0
cocoapods-try : 1.2.0
```
### Podfile
```ruby
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'albums' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
target 'albumsTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'albums-tvOS' do
# Pods for albums-tvOS
target 'albums-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
```
### Error
```
LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle - /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:74:in `cdn_url?'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:178:in `block in sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:177:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:177:in `sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:414:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/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.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
```
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
EDIT
for a one react-native project(newly created one) #Leri Gogsadze's answer was working. I cloned a repo which is already developed react-native app, and had the same issue, in that project, I tried the solution suggested by #Leri but did't work react-native run-ios build failed, then I tried pod update command and it now gives me the below error.
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Auto-linking React Native modules for target `GregMobileSecondPhase`: BVLinearGradient, RNCAsyncStorage, RNCMaskedView, RNCPicker, RNDateTimePicker, RNDeviceInfo, RNFBApp, RNFBMessaging, RNFS, RNGestureHandler, RNImageCropPicker, RNKeychain, RNReanimated, RNSVG, RNScreens, RNVectorIcons, ReactNativeART, react-native-add-calendar-event, react-native-document-picker, react-native-fbsdk, react-native-geolocation-service, react-native-maps, react-native-safe-area-context, react-native-slider, react-native-viewpager, react-native-webview, and rn-range-slider
Update all pods
Updating local specs repositories
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
### Command
```
/usr/local/bin/pod update
```
### Report
* What did you do?
* What did you expect to happen?
* What happened instead?
### Stack
```
CocoaPods : 1.10.0
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]
RubyGems : 3.0.3
Host : macOS 11.1 (20C69)
Xcode : 12.3 (12C33)
Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
```
### Plugins
```
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-trunk : 1.5.0
cocoapods-try : 1.2.0
```
### Podfile
```ruby
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'GregMobileSecondPhase' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
pod 'Firebase/Analytics'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
target 'GregMobileSecondPhaseTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'GregMobileSecondPhase-tvOS' do
# Pods for GregMobileSecondPhase-tvOS
target 'GregMobileSecondPhase-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
```
### Error
```
LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle - /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in <top (required)>'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:440:in `download_typhoeus_impl_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:372:in `download_and_save_with_retries_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:365:in `download_file_async'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:78:in `deprecated_local_podspecs'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:60:in `preheat_existing_files'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.10.0/lib/cocoapods-core/cdn_source.rb:257:in `update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:135:in `block (3 levels) in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:134:in `block (2 levels) in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:133:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:133:in `block in update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:131:in `open'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/sources_manager.rb:131:in `update'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:145:in `block in update_repositories'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:143:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer/analyzer.rb:143:in `update_repositories'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/installer.rb:160:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/lib/cocoapods/command/update.rb:63: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.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.10.0/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
```
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+missing+compatible+arch+in+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
Found no similar issues. To create a new issue, please visit:
https://github.com/cocoapods/cocoapods/issues/new
[!] NPM package '#react-native-firebase/messaging' depends on '#react-native-firebase/app' v10.3.0 but found v10.2.0, this might cause build issues or runtime crashes.
saniranimantha#Saniras-MBP ios % ~
Seems it's related to Ruby ffi. Run the following commands:
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
sudo arch -x86_64 gem install ffi
Then
arch -x86_64 pod install
This works for Apple M1 Chip. Confirmed.
on Apple Silicon and MacOS Big Sur, I fixed it this way and it worked
Locate Terminal.app in Finder
Right-click and choose Get Info
Check the Open using Rosetta
Quit Terminal app and run it again
Run sudo gem install ffi
Run pod install
See detail at: https://armen-mkrtchian.medium.com/run-cocoapods-on-apple-silicon-and-macos-big-sur-developer-transition-kit-b62acffc1387
or we can do it, it works for me:
sudo gem uninstall cocoapods
brew install cocoapods
for homebrew users
step 1 brew install cocoapods
step 2 sudo arch -x86_64 gem install ffi
step 3 arch -x86_64 pod install
fixed my issue
and if problem is still persisting you might have installed node.js with other platform rather than homebrew
I had faced the same issue, while doing pod install in React native project, running on M1 chip MacBook. This helped me to resolve the issue.
Open the rosetta terminal and type below commands.
-- sudo rm -rf ~/.cocoapods/repos
Inside the ios folder of the project, type the below command :
pod install
For me what worked was recloning the repo and starting all over.
You can also try to update cocoapods, last case update also Xcode and re-cloning the repo.
There is currently missmatch regarding the pods, libraries, dependencies and Xcode, for example the Firebase SDK that you also use is updating frequently.
My setup:
Xcode 12.4
Mac M1
react-native 63.4
I faced the same issue. Below are the steps i followed. The issue got resolved.
Install ruby in homebrew (brew install ruby)
Add export PATH=/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.0.0/bin:$PATH to your .zshrc
source ~/.zshrc
sudo gem install -n /usr/local/bin cocoapods
pod setup
arch -arm64 gem install ffi
change to project directory inside ios folder execute the following command
arch -arm64 pod install
Related
✖ Installing Bundler error in react-native project
error Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5 Ignoring io-console-0.6.0 because its extensions are not built. Try: gem pristine io-console --version 0.6.0 Ignoring json-2.6.3 because its extensions are not built. Try: gem pristine json --version 2.6.3 Ignoring openssl-3.1.0 because its extensions are not built. Try: gem pristine openssl --version 3.1.0 Ignoring psych-5.1.0 because its extensions are not built. Try: gem pristine psych --version 5.1.0 Ignoring racc-1.6.2 because its extensions are not built. Try: gem pristine racc --version 1.6.2 Ignoring readline-ext-0.1.5 because its extensions are not built. Try: gem pristine readline-ext --version 0.1.5 Ignoring stringio-3.0.5 because its extensions are not built. Try: gem pristine stringio --version 3.0.5 Ignoring strscan-3.0.5 because its extensions are not built. Try: gem pristine strscan --version 3.0.5 Ignoring zlib-3.0.0 because its extensions are not built. Try: gem pristine zlib --version 3.0.0 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require': incompatible library version - /Users/admin/.rvm/gems/ruby-2.7.5/gems/zlib-3.0.0/lib/zlib.bundle (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/fetcher.rb:6:in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli/install.rb:53:in run' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli.rb:235:in block in install' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/settings.rb:143:in temporary' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli.rb:234:in install' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in run' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in dispatch' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli.rb:27:in dispatch' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in start' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/cli.rb:18:in start' from /Library/Ruby/Gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in block in <top (required)>' from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in with_friendly_errors' from /Library/Ruby/Gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in <top (required)>' from /usr/local/bin/bundle:23:in load' from /usr/local/bin/bundle:23:in ' ✖ 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/admin/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] (/Users/admin/node_modules/#react-native-community/cli/build/commands/init/init.js:181:3) at async Command.handleAction (/Users/admin/node_modules/#react-native-community/cli/build/index.js:106:9) info Run CLI with --verbose flag for more details. initiating react-native project .
Failed to install rbenv on macOS Monterey 12.3.1 Intel core i5
I have tried to install with normal installation (rbenv install 2.7.6) or with RUBY_CFLAGS still no luck! rbenv --version rbenv 1.2.0 , gem which cocoapods /Users/mymac/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.11.3/lib/cocoapods.rb , Xcode 13.4 , mymac#MacBook-Pro% RUBY_CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.7.6 Downloading ruby-2.7.6.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.6.tar.bz2 Installing ruby-2.7.6... ruby-build: using readline from homebrew BUILD FAILED (macOS 12.3.1 using ruby-build 20220426) Inspect or clean up the working tree at /var/folders/n5/d88l_sl9071gns5xdqk_myww0000gn/T/ruby-build.20220528201149.40536.2UiW6F Results logged to /var/folders/n5/d88l_sl9071gns5xdqk_myww0000gn/T/ruby-build.20220528201149.40536.log Last 10 log lines: from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem' from ./tool/rbinstall.rb:279:in `open_for_install' from ./tool/rbinstall.rb:845:in `block in install_default_gem' from ./tool/rbinstall.rb:835:in `each' from ./tool/rbinstall.rb:835:in `install_default_gem' from ./tool/rbinstall.rb:799:in `block in <main>' from ./tool/rbinstall.rb:950:in `block in <main>' from ./tool/rbinstall.rb:947:in `each' from ./tool/rbinstall.rb:947:in `<main>' make: *** [do-install-all] Error 1 Please anybody help. Thank you.
The error saying you are trying to downgrade the env. check ruby -v upgrade it to latest version rbenv install 3.1.2 # or whichever is latest See this https://gorails.com/setup/osx/12-monterey follow it with rbenv global 3.1.2 eval "$(rbenv init -)" gem update --system
React Native pod install failed on Apple Silicon (M1)
I got my new Macbook Pro which has M1 chip. I tried to run my react native project but stucked on pod install. After that, I created an empty project and tried on that still getting the same error. ### Command ``` /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/bin/pod install ``` ### Report * What did you do? * What did you expect to happen? * What happened instead? ### Stack ``` CocoaPods : 1.10.1 Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20] RubyGems : 3.0.3 Host : macOS 11.0.1 (20B29) Xcode : 12.4 (12D4e) Git : git version 2.24.3 (Apple Git-128) Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib Repositories : ``` ### Plugins ``` cocoapods-deintegrate : 1.0.4 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.0 cocoapods-trunk : 1.5.0 cocoapods-try : 1.2.0 ``` ### Podfile ```ruby require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules' platform :ios, '10.0' target 'temp2' do config = use_native_modules! use_react_native!(:path => config["reactNativePath"]) target 'temp2Tests' do inherit! :complete # Pods for testing end # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. use_flipper! post_install do |installer| flipper_post_install(installer) end end target 'temp2-tvOS' do # Pods for temp2-tvOS target 'temp2-tvOSTests' do inherit! :search_paths # Pods for testing end end ``` ### Error ``` LoadError - dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle - /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in <top (required)>' /Library/Ruby/Gems/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' /Library/Ruby/Gems/2.6.0/gems/ethon-0.12.0/lib/ethon.rb:2:in `<top (required)>' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' /Library/Ruby/Gems/2.6.0/gems/typhoeus-1.4.0/lib/typhoeus.rb:2:in `<top (required)>' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:74:in `cdn_url?' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:36:in `create_source_with_url' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/sources_manager.rb:21:in `find_or_create_source_with_url' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:178:in `block in sources' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `map' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:177:in `sources' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1073:in `block in resolve_dependencies' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/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' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/bin/pod:23:in `load' /opt/homebrew/Cellar/cocoapods/1.10.1/libexec/bin/pod:23:in `<main>' ``` ――― TEMPLATE END ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― [!] Oh no, an error occurred. Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+missing+compatible+arch+in+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle&type=Issues If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md Don't forget to anonymize any private data! Looking for related issues on cocoapods/cocoapods... - Couldn't determine repo type for URL: `https://cdn.cocoapods.org/`: Invalid ABI specified https://github.com/CocoaPods/CocoaPods/issues/10368 [open] [2 comments] a week ago - CocoaPods compatibility with Apple DTK (Apple Silicon) https://github.com/CocoaPods/CocoaPods/issues/9907 [open] [75 comments] 15 hours ago - Firebase installation error on xcode 12 com m1 processor https://github.com/CocoaPods/CocoaPods/issues/10329 [closed] [4 comments] 12 hours ago and 3 more at: https://github.com/cocoapods/cocoapods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle%2C%200x0009%29%3A%20missing%20compatible%20arch%20in%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle%20-%20%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.14.2%2Flib%2Fffi_c.bundle&type=Issues&utf8=✓ After I make research about this topic I found several solutions but still my problem is not solved. I already tried to install sudo gem install ffi and then tried pod install again. Still getting same error. After that according to my research some people said to use terminal with rosetta or the another way to rosetta, sudo arch -x86_64 gem install ffi arch -x86_64 pod install with these Intel based installation try I'm getting below error: Analyzing dependencies Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec` Fetching podspec for `Folly` from `../node_modules/react-native/third-party-podspecs/Folly.podspec` Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec` [!] Couldn't determine repo type for URL: `https://cdn.cocoapods.org/`: Invalid ABI specified Did somebody faced with this problem? What I'm doing wrong or what I need to do to run my project?
for homebrew users step 1 brew install cocoapods step 2 sudo arch -x86_64 gem install ffi step 3 arch -x86_64 pod install fixed my issue
My problem with ffi resolved with just brew install cocoapods =) Firstly I tried to install from bundler and there was a specific old version of cocoapods which didn't support m1 yet; then I used brew and now with the latest cocoapods it works fine
This resource helped me: https://www.lopau.com/error-running-cocoapod-pod-install-on-big-sur-with-ffi/ Run sudo gem inst ffi -- --disable-system-libffi
My problem was installing cocoapods with gem (which most tutorials online will tell you). Try uninstalling cocoapods with the following command: gem uninstall cocoapods Then install it again using brew brew install cocoapods homebrew installed the arm64 version, while gem seems to default to something else.
I realized that homebrew installation messed up cocoapods. Simply, I uninstalled homebrew and start from beginning. Then it worked.
this worked for me: (M1 Pro) arch -x86_64 sudo gem install cocoapods arch -x86_64 pod repo update arch -x86_64 pod install sources: https://github.com/CocoaPods/CocoaPods/issues/10349
I faced the same issue on M1 chip MacBook. Finally did the below In rosetta terminal : -- sudo rm -rf ~/.cocoapods/repos Inside iOS folder pod install
the solution for me was to init the app like this arch -x86_64 npx react-native init awsomeproject
Install the latest version of Xcode from App Store, and then run these two commands in the Terminal: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer sudo xcodebuild -runFirstLaunch
In my case the problem was that CocoaPod flipper was out of date. The change in the pod file from use_flipper()! to use_flipper!({ 'Flipper' => '0.95.0', 'Flipper-Folly' => '2.6.7', 'Flipper-RSocket' => '1.4.3', 'Flipper-DoubleConversion' => '3.1.7', 'Flipper-Glog' => '0.3.9', 'Flipper-PeerTalk' => '0.0.4' }) helped me.
Mac M1 architecture is not directly compatible with Cocoapods. If you encounter issues when installing pods, you can solve it by running: sudo arch -x86_64 gem install ffi arch -x86_64 pod install These commands install the ffi package, to load dynamically-linked libraries and let you run the pod install properly, and runs pod install with the proper architecture.
For me, this command worked arch -x86_64 pod install
No able to install compass since upgrading mac to El-Capitan
I am pretty sure this problem started only since I upgraded OS to El-Capitan. Tried running sudo gem install -n /usr/local/bin compass And I am getting the error ERROR: Error installing compass: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160413-36157-1bn6ytd.rb extconf.rb checking for ffi.h... /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1038:in `block in have_header' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:889:in `block in checking_for' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:888:in `checking_for' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1037:in `have_header' from extconf.rb:16:in `<main>' extconf failed, exit code 1 Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.6 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/ffi-1.9.6/gem_make.out Xcode is already installed so I have no idea what the problem is. Any help would be appreciated. Thanks!
Bundle Install Fails with unicorn gem on kgio install
I tried to add the unicorn gem to my gem file and when I run bundle install I get the following error: Installing kgio (2.8.1) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb checking for CLOCK_MONOTONIC in time.h... *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:686:in `macro_defined?' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:822:in `block in have_macro' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/mkmf.rb:821:in `have_macro' from extconf.rb:5:in `<main>' Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/kgio-2.8.1 for inspection. Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/kgio-2.8.1/ext/kgio/gem_make.out An error occurred while installing kgio (2.8.1), and Bundler cannot continue. Make sure that `gem install kgio -v '2.8.1'` succeeds before bundling. Prior to including the unicorn gem I have no problems running bundle install. It appears to be failing while trying to install kgio 2.8.1. I've searched for solutions on Stackoverflow and elsewhere, the most common solution appears to be to install the Xcode development tools. I've done this and it has not resolved the issue. I'm running Mac OSX 10.9.1 Mavericks with Ruby 1.9.3p392. Really need to get this resolved, any help would be very much appreciated.
I updated to Ruby 2.1 and the problem was resolved.