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

Read .ruby-version file in Gemfile #35410

Closed
wants to merge 1 commit into from
Closed

Read .ruby-version file in Gemfile #35410

wants to merge 1 commit into from

Conversation

dcangulo
Copy link
Contributor

Summary

When updating the Ruby version, 2 files are always needed to be updated (.ruby-version and Gemfile). When not in sync it can lead to an error like Your Ruby version is 2.7.6, but your Gemfile specified 2.7.5.

This lessens the files that need to be updated when upgrading the Ruby version and makes it in sync always. It makes the .ruby-version the source of truth.

Example 1:

Screenshot 2022-11-20 at 13 56 08

When upgrading from 0.70.0 to 0.71.0-rc.0. 2 files needs to be updated when it could have been just 1.

Source: https://react-native-community.github.io/upgrade-helper/?from=0.70.0&to=0.71.0-rc.0

Example 2:

21c8837 updates 4 files (.ruby-version, Gemfile, template/Gemfile, template/_ruby-version) when it could have been just 2.

Other Sources:

Changelog

[General] [Changed] - Read .ruby-version file in Gemfile

Test Plan

Only .ruby-version and template/_ruby-version needs to be updated when upgrading Ruby version.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 20, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 81e441a
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,102,440 +0
android hermes armeabi-v7a 6,470,493 +0
android hermes x86 7,519,895 +0
android hermes x86_64 7,378,573 +0
android jsc arm64-v8a 8,967,309 +0
android jsc armeabi-v7a 7,698,152 +0
android jsc x86 9,029,418 +0
android jsc x86_64 9,507,263 +0

Base commit: 81e441a
Branch: main

@pull-bot
Copy link

PR build artifact for 3875a23 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@pull-bot
Copy link

PR build artifact for 3875a23 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@facebook-github-bot
Copy link
Contributor

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

kelset pushed a commit that referenced this pull request Nov 22, 2022
Summary:
When updating the Ruby version, 2 files are always needed to be updated (`.ruby-version` and `Gemfile`). When not in sync it can lead to an error like `Your Ruby version is 2.7.6, but your Gemfile specified 2.7.5`.

This lessens the files that need to be updated when upgrading the Ruby version and makes it in sync always. It makes the `.ruby-version` the source of truth.

### Example 1:

<img width="481" alt="Screenshot 2022-11-20 at 13 56 08" src="https://user-images.githubusercontent.com/36528176/202888191-450ab6d0-32a4-4d37-ad82-0beb2b22fa82.png">

When upgrading from `0.70.0` to `0.71.0-rc.0`. 2 files needs to be updated when it could have been just 1.

Source: https://react-native-community.github.io/upgrade-helper/?from=0.70.0&to=0.71.0-rc.0

### Example 2:

21c8837 updates 4 files (`.ruby-version`, `Gemfile`, `template/Gemfile`, `template/_ruby-version`) when it could have been just 2.

### Other Sources:
* https://andycroll.com/ruby/read-ruby-version-in-your-gemfile/
* https://render.com/docs/ruby-version (Heroku alternative)
* https://stackoverflow.com/a/35823132/9375533

## Changelog

[General] [Changed] - Read `.ruby-version` file in `Gemfile`

Pull Request resolved: #35410

Test Plan: Only `.ruby-version` and `template/_ruby-version` needs to be updated when upgrading Ruby version.

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D41429147

Pulled By: rshest

fbshipit-source-id: 9e541a1d84aed5dca1e6f465c61bb0ba15574211
@dcangulo dcangulo deleted the feature/read-ruby-version branch November 24, 2022 15:01
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
When updating the Ruby version, 2 files are always needed to be updated (`.ruby-version` and `Gemfile`). When not in sync it can lead to an error like `Your Ruby version is 2.7.6, but your Gemfile specified 2.7.5`.

This lessens the files that need to be updated when upgrading the Ruby version and makes it in sync always. It makes the `.ruby-version` the source of truth.

### Example 1:

<img width="481" alt="Screenshot 2022-11-20 at 13 56 08" src="https://user-images.githubusercontent.com/36528176/202888191-450ab6d0-32a4-4d37-ad82-0beb2b22fa82.png">

When upgrading from `0.70.0` to `0.71.0-rc.0`. 2 files needs to be updated when it could have been just 1.

Source: https://react-native-community.github.io/upgrade-helper/?from=0.70.0&to=0.71.0-rc.0

### Example 2:

21c8837 updates 4 files (`.ruby-version`, `Gemfile`, `template/Gemfile`, `template/_ruby-version`) when it could have been just 2.

### Other Sources:
* https://andycroll.com/ruby/read-ruby-version-in-your-gemfile/
* https://render.com/docs/ruby-version (Heroku alternative)
* https://stackoverflow.com/a/35823132/9375533

## Changelog

[General] [Changed] - Read `.ruby-version` file in `Gemfile`

Pull Request resolved: facebook#35410

Test Plan: Only `.ruby-version` and `template/_ruby-version` needs to be updated when upgrading Ruby version.

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D41429147

Pulled By: rshest

fbshipit-source-id: 9e541a1d84aed5dca1e6f465c61bb0ba15574211
@cipolleschi cipolleschi mentioned this pull request Oct 11, 2023
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants