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
Run rails new
using specified prerelease version
#39663
Conversation
09b877c
to
964adc1
Compare
bundle_command("install", "BUNDLE_GEMFILE" => gemfile) | ||
|
||
require "shellwords" | ||
bundle_command("exec rails #{self_command} #{Shellwords.join(@argv)}", "BUNDLE_GEMFILE" => gemfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this commit in my machine and the fact that "BUNDLE_GEMFILE"
is being set here is causing all the commands in the real generator to use this gemfile instead of the application's gemfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I had tested this with --skip-webpack-install
for performance reasons, and it worked, but I see now how it affects e.g. rails webpacker:install
. I can fix that, but instead I'm going to try a slightly different approach that doesn't require setting BUNDLE_GEMFILE
.
Application templates will still be affected by the bundle exec
, but they can use an inline gemfile to require
third-party gems, if they need them.
964adc1
to
7dfff9e
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
7dfff9e
to
f773867
Compare
f773867
to
c8a3905
Compare
834e3ba
to
c728b8e
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Hey @jonathanhefner - is this still a WIP or would you like for folks to try it out :) |
0eb681a
to
b743ac0
Compare
@Schwad Yes, please do test it out! 🙏 😃 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
b743ac0
to
5af854e
Compare
5af854e
to
74b9456
Compare
74b9456
to
11eaa3d
Compare
When running `rails new` with a prerelease flag like `--edge`, the project's Gemfile will point to the specified prerelease version, but the project itself is generated using the active version of Rails. This can cause problems if, for example, the prerelease version expects a different file structure than the active version. It also precludes using generator options that are new in the prerelease version. This commit adds a mechanism to install and use prerelease versions of Rails when running `rails new`. Closes rails#38761. Co-authored-by: Nick Schwaderer <nicholas.schwaderer@gmail.com>
11eaa3d
to
218412f
Compare
Run `rails new` using specified prerelease version
When running
rails new
with a prerelease flag like--edge
, the project's Gemfile will point to the specified prerelease version, but the project itself is generated using the active version of Rails. This can cause problems if, for example, the prerelease version expects a different file structure than the active version. It also precludes using generator options that are new in the prerelease version.This commit adds a mechanism to install and use prerelease versions of Rails when running
rails new
.Closes #38761.
/cc @Schwad I added you as a co-author since you've been exploring this.