Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Keep generating a Gemfile in bundle init for Bundler 2 and add an option to generate gems.rb #6269

Closed

Conversation

colby-swandale
Copy link
Member

@colby-swandale colby-swandale commented Jan 23, 2018

What was the end-user problem that led to this PR?

The bundle init command in Bundler 2 currently generates a gems.rb file by default. The issue with this is that i believe we're pushing gems.rb as a "successor" to the Gemfile that everyone should be using even though there is no real incentive for nearly any ruby project to do so.

All the documentation on the internet about the the gemfile is referred to as Gemfile which I can see will confuse new users to Ruby. If they're looking to add a gem to their project and see the project's README there is a very good chance it will say to "add to the Gemfile and run bundle install" Example 1, Example 2 people will get confused from this. Or if they're learning Bundler for the first time and come across a blog post that talks about the gemfile which is actually gems.rb in their project will also cause confusion for the user.

The last issue i see is that we'll be creating a situation where a lot of projects will be using Gemfile and others will be using gems.rb and that this transition may never be complete because the incentive is just not there.

I believe these issues outweigh the benefit of forcing gems.rb onto users in the UI and I want to propose that we instead have bundle init keep generating a Gemfile as it has been but introduce an option to generate a gems.rb if the user needs it.

(Note: the bundle gem command is un-effected as we didn't get around to update the command to use gems.rb in Bundler 2)

What is your fix for the problem, implemented in this PR?

Make bundle init continue to generate a Gemfile by default and add an option to allow generating a gems.rb file if needed.

cc @indirect @segiddins

@colby-swandale colby-swandale changed the title Remove generating gems.rb in Bundler 2 with bundle init and instead make it an option Keep generating a Gemfile in bundle init for Bundler 2 and add an option to generate gems.rb Jan 23, 2018
@segiddins
Copy link
Member

I think I agree with this line of reasoning?

@colby-swandale
Copy link
Member Author

@segiddins did you have any questions?

@indirect
Copy link
Member

I think I'm okay with this. In the interests of reducing surprise, shipping 2.x without making gems.rb the default seems reasonable. Then we can have the discussion about possibly changing the default again when we get to 3.0. 🙂

@indirect
Copy link
Member

After thinking about this for a few more minutes, I personally would like to be able to set a config flag with the same effect as --gemsrb. Can we keep the code that makes it a setting, but remove the default value change for Bundler 2?

@segiddins
Copy link
Member

@colby-swandale no questions. Just saying I think I agree, but I'm not 100% sure what the right thing to do is :)

@bundlerbot
Copy link
Collaborator

☔ The latest upstream changes (presumably #6266) made this pull request unmergeable. Please resolve the merge conflicts.

@deivid-rodriguez
Copy link
Member

I agree with this PR in combination with @indirect's suggestion of keeping the feature flag! 👍

@indirect
Copy link
Member

indirect commented Feb 1, 2018

@colby-swandale still interested in re-enabling the feature flag and merging this?

@colby-swandale colby-swandale added this to the 1.16.2 milestone Feb 2, 2018
@colby-swandale
Copy link
Member Author

i'll put the setting back.

@colby-swandale colby-swandale removed this from the 1.16.2 milestone Feb 5, 2018
@colby-swandale colby-swandale force-pushed the colby/remove-bundler-init-default-gemsrb branch from a650968 to 85e7249 Compare March 1, 2018 11:22
@deivid-rodriguez
Copy link
Member

This PR was superseded by #7113, which implements the same line of reasoning, so closing!

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

Successfully merging this pull request may close these issues.

5 participants