Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning when running bundle exec command - Your RubyGems version (3.0.3.1) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3 #37183

Closed
Adnan-Bacic opened this issue May 1, 2023 · 9 comments

Comments

@Adnan-Bacic
Copy link
Contributor

Description

when running a pod command such as pod install, there are no warnings. however if you run bundle exec pod install then it shows a console warning:

Your RubyGems version (3.0.3.1) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3

happens on 0.70.8. i also tried creating a brand new project running the newest 0.71.6 version and its the same result.

its required/better to run bundle exec pod install instead of just pod install, otherwise it may not use your projects version of CocoaPods when downloading pods.

React Native Version

0.70.8

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 13.3.1
CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 32.79 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: 3.2.0 - ~/.nvm/versions/node/v16.13.2/bin/yarn
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
Watchman: 2023.04.10.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/adb/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK:
API Levels: 23, 28, 29, 30, 31, 32, 33
Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 33.0.0, 33.0.2
System Images: android-29 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-31 | Google APIs Intel x86 Atom_64, android-32 | Google APIs Intel x86_64 Atom, android-33 | Google APIs Intel x86_64 Atom, android-33 | Google Play Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.9862592
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 11.0.14.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.1.0 => 18.1.0
react-native: 0.70.8 => 0.70.8
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  1. init new project with npx react-native@latest init AwesomeProject
  2. cd ios
  3. bundle exec pod install

Snack, code example, screenshot, or link to a repository

Screenshot 2023-05-01 at 10 17 01

@github-actions
Copy link

github-actions bot commented May 1, 2023

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@cipolleschi
Copy link
Contributor

Hi @Adnan-Bacic, thanks for the question.
I think that this is a issue with the local setup. As the error is mentioning: Your RubyGems version (3.0.3.1) has a bug....

Have you tried to update it as suggested by using gem update --system 3.2.3 to see if it fixes the problem?

@Adnan-Bacic
Copy link
Contributor Author

Adnan-Bacic commented May 2, 2023

i assumed this was related to some sort of react-native versioning.

i tried running the command. but i started getting a lot of errors.

when running bundle install:

/Library/Ruby/Site/2.6.0/rubygems.rb:263:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
        from /Library/Ruby/Site/2.6.0/rubygems.rb:282:in `activate_bin_path'
        from /usr/local/bin/bundle:23:in `<main>'

gem install bundler:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.

the most simple and straightforward solution was to just run rbenv local 2.6.10 or rbenv local 2.7.5, this will add back the .ruby-version file which was previously added and then removed. this saves me having to follow other complicated guides.

before adding the .ruby-version file, rbenv version returns system, which is 2.6.10 according to ruby -v.

im not sure what the exact problem is. i see the error messages refer to version 2.6.0, while my system ruby version is 2.6.10.

either way, the local .ruby-version file with a version number seems to fix the error. i can run gem install bundler, bundle install and bundle exec pod install again without errors.

@cipolleschi
Copy link
Contributor

Happy that you found a solution that works for you. I think that there is something wanky going on with the local Ruby setup, but it should not be React Native specifically as it doesn't enforce any Ruby version anymore! ;)

@starterProgrammer
Copy link

This steps work for me perfectly to create react native project without error
1- npx react-native init testproject --skip-install -—npm
2- cd testproject
3- npm install or yearn install
4- cd ios
5- bundle config --local build.ffi --with-cflags=-Wno-error=implicit-function-declaration
6- bundle install
7- bundle exec pod install

@starterProgrammer
Copy link

Chek This link for more information

@alitalaee
Copy link

This steps work for me perfectly to create react native project without error 1- npx react-native init testproject --skip-install -—npm 2- cd testproject 3- npm install or yearn install 4- cd ios 5- bundle config --local build.ffi --with-cflags=-Wno-error=implicit-function-declaration 6- bundle install 7- bundle exec pod install

Thanks it helps me really

@saurabhsaneja
Copy link

i could only fix this by upgrading ruby on mac

https://snyk.io/blog/how-to-install-ruby-in-mac-os/

@cipolleschi
Copy link
Contributor

Have you tried upgrading RubyGems as the warning suggested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants