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
Prevent webpacker:install failures on missing Gemfile #41104
Prevent webpacker:install failures on missing Gemfile #41104
Conversation
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'm not sure if this is how we want to address #41103. See #41103 (comment).
railties/lib/rails/generators/rails/app/templates/bin/spring.tt
Outdated
Show resolved
Hide resolved
Hi sorry for delay but I think skipping webpack together with bundle or gemfile is not so appealing as it may look. In such case rails commands fail randomly expecting webpacker configuration to be present. I believe the best solution is to pass silently on spring until it eventually can be started when lockfile is generated. Cheers |
|
Sorry for my comments being overall chaotic. I will try to illustrate my reasoning in a more organized manner. Yes skipping webpack installation shouldn't happen unless gems are installed, that makes perfect sense. But I wonder if there may be an alternative worth a little consideration. I understand that without gems installed app shouldn't be in usable state but please let me illustrate my doubts by simple example. First lets create app using There are two interesting things going on here. First is that rails relies on non locked webpacker gem. If after creating new app and before running console I will edit non locked So I wonder if it would be a valid idea to enforce bundle installation before any rails command could actually be executed. Like for example by adding check for locked gems in binstubs. Maybe it could simplify or replace gemfile related error handling in situations similar to those described above. The other potential benefit would be that But if idea would turn out to be viable probably the biggest benefit would be that all similar issues would be prevented in the future. Cheers |
bundler already does that.
This is not possible. It only generated the Gemfile.lock if all the gems are installed. See
|
Thx for pointing this out, I have to admit I wasn't aware of that. I guess that makes my idea somewhat less appealing 😃 . Its also beyond of the scope of this PR anyways. I did requested change and simplified message a bit. Please have a look. Cheers |
Hello, thx I'm not native speaker so my english isn't perfect :/ I went for less explicit message as it may skip bundle with other options as well (for now only --pretend) so I think it will be more universal without hardcoded option list. Cheers |
Prevent webpacker:install failures on missing Gemfile
@f6p This is great! Thank you for working on this! |
@jonathanhefner Thank you sir for the kind words and feedback that made this PR possible. My contribution is a minor one but I'm glad I could help. Cheers |
fixes #41103 causing
rails webpacker:install
to fail when creating new app