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

[Chore] Remove .ruby-version and update Gemfile to support multiple versions of Ruby #36281

Closed
wants to merge 1 commit into from

Conversation

cipolleschi
Copy link
Contributor

Summary

This Change remove the need to have a specific version of Ruby installed. We are now supporting a wider range of Ruby versions, starting from Ruby 2.6.10 (the ruby installed on MacOS by default).
We are still using a Gemfile to control the version of cocoapods that needs to be installed.

Changelog

[IOS] [CHANGED] - Remove .ruby-version and update Gemfile to support a wider range of Ruby versions

Test Plan

  • Tested locally on RNTester and an app from template, switch across different versions of Ruby
  • CircleCI is green on the commit

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Feb 24, 2023
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

Gemfile Outdated
@@ -1,7 +1,7 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby File.read(File.join(__dir__, '.ruby-version')).strip
ruby ">= 2.6"
Copy link
Collaborator

@tido64 tido64 Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested with latest 3.2.1? Last I checked (I think it was 3.2.0), CocoaPods just crashed. I had to downgrade to 3.1.3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested with 3.1.2 and 3.1.3, actually.

Good call, let me check with those as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call @tido64: cocoapods explodes because of this error:

NoMethodError - undefined method `=~' for []:Array
/Users/cipolleschi/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/target/build_settings.rb:446:in `block (2 levels) in merged_xcconfigs'

Looking at the reported line it seems that they are using =~.

However this commit seems like it has fixed it, but they haven't done a release of Cocoapods yet with the fix.

Copy link
Contributor

@blakef blakef Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CleanShot 2023-02-24 at 16 19 06

We should document that RVM doesn't like relative versions (only absolute versions) when navigating into a project directory.

@analysis-bot
Copy link

analysis-bot commented Feb 24, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,458,775 -12,638
android hermes armeabi-v7a 7,781,991 -11,530
android hermes x86 8,934,655 -12,189
android hermes x86_64 8,791,754 -12,375
android jsc arm64-v8a 9,092,968 -12,300
android jsc armeabi-v7a 8,291,023 -11,188
android jsc x86 9,143,759 -11,841
android jsc x86_64 9,402,643 -12,015

Base commit: febf6b7
Branch: main

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@cipolleschi cipolleschi force-pushed the test/no_ruby_file branch 4 times, most recently from 22a019c to 7f45415 Compare February 24, 2023 14:17
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@cortinico
Copy link
Contributor

This needs a follow-up PR here: https://github.com/react-native-community/cli/blob/63022103bebc9202d15255d8d2a6b90ce7401bf0/packages/cli-doctor/src/tools/versionRanges.ts#L6

@cipolleschi cipolleschi force-pushed the test/no_ruby_file branch 2 times, most recently from cb4cf6b to 6bb25a5 Compare February 26, 2023 09:22
@cipolleschi
Copy link
Contributor Author

This needs a follow-up PR here: https://github.com/react-native-community/cli/blob/63022103bebc9202d15255d8d2a6b90ce7401bf0/packages/cli-doctor/src/tools/versionRanges.ts#L6

Yup, we are tracking this batch of work in an internal dashboard!

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 26, 2023
@facebook-github-bot
Copy link
Contributor

@cipolleschi merged this pull request in e57b6d1.

@Bardiamist
Copy link
Contributor

Haha, tried to install ruby 2.7.6 so long:D
Btw Cocoa Pods current vesion updated to 1.12.0 and looks good to use it without rollback

@kelset kelset deleted the test/no_ruby_file branch March 10, 2023 10:48
Saadnajmi pushed a commit to microsoft/react-native-macos that referenced this pull request Apr 5, 2023
…of Ruby (facebook#36281)

Summary:
This Change remove the need to have a specific version of Ruby installed. We are now supporting a wider range of Ruby versions, starting from Ruby 2.6.10 (the ruby installed on MacOS by default).
We are still using a Gemfile to control the version of cocoapods that needs to be installed.

## Changelog

[IOS] [CHANGED] - Remove `.ruby-version` and update Gemfile to support a wider range of Ruby versions

Pull Request resolved: facebook#36281

Test Plan:
- Tested locally on RNTester and an app from template, switch across different versions of Ruby
- CircleCI is green on the commit

Reviewed By: cortinico

Differential Revision: D43567660

Pulled By: cipolleschi

fbshipit-source-id: e7edfe5806a898a83ba39cb58b1318ebde56a57c
Saadnajmi pushed a commit to microsoft/react-native-macos that referenced this pull request Apr 5, 2023
…of Ruby (facebook#36281)

Summary:
This Change remove the need to have a specific version of Ruby installed. We are now supporting a wider range of Ruby versions, starting from Ruby 2.6.10 (the ruby installed on MacOS by default).
We are still using a Gemfile to control the version of cocoapods that needs to be installed.

## Changelog

[IOS] [CHANGED] - Remove `.ruby-version` and update Gemfile to support a wider range of Ruby versions

Pull Request resolved: facebook#36281

Test Plan:
- Tested locally on RNTester and an app from template, switch across different versions of Ruby
- CircleCI is green on the commit

Reviewed By: cortinico

Differential Revision: D43567660

Pulled By: cipolleschi

fbshipit-source-id: e7edfe5806a898a83ba39cb58b1318ebde56a57c
Saadnajmi pushed a commit to microsoft/react-native-macos that referenced this pull request Apr 5, 2023
…of Ruby (facebook#36281)

Summary:
This Change remove the need to have a specific version of Ruby installed. We are now supporting a wider range of Ruby versions, starting from Ruby 2.6.10 (the ruby installed on MacOS by default).
We are still using a Gemfile to control the version of cocoapods that needs to be installed.

## Changelog

[IOS] [CHANGED] - Remove `.ruby-version` and update Gemfile to support a wider range of Ruby versions

Pull Request resolved: facebook#36281

Test Plan:
- Tested locally on RNTester and an app from template, switch across different versions of Ruby
- CircleCI is green on the commit

Reviewed By: cortinico

Differential Revision: D43567660

Pulled By: cipolleschi

fbshipit-source-id: e7edfe5806a898a83ba39cb58b1318ebde56a57c
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…of Ruby (facebook#36281)

Summary:
This Change remove the need to have a specific version of Ruby installed. We are now supporting a wider range of Ruby versions, starting from Ruby 2.6.10 (the ruby installed on MacOS by default).
We are still using a Gemfile to control the version of cocoapods that needs to be installed.

## Changelog

[IOS] [CHANGED] - Remove `.ruby-version` and update Gemfile to support a wider range of Ruby versions

Pull Request resolved: facebook#36281

Test Plan:
- Tested locally on RNTester and an app from template, switch across different versions of Ruby
- CircleCI is green on the commit

Reviewed By: cortinico

Differential Revision: D43567660

Pulled By: cipolleschi

fbshipit-source-id: e7edfe5806a898a83ba39cb58b1318ebde56a57c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants