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

Remove Gemfile.lock from the gem #3147

Closed
wants to merge 1 commit into from
Closed

Remove Gemfile.lock from the gem #3147

wants to merge 1 commit into from

Conversation

vassilevsky
Copy link

"When developing a gem, use the gemspec method in your Gemfile
to avoid duplication. In general, a gem's Gemfile should contain
the Rubygems source and a single gemspec line.

Do not check your Gemfile.lock into version control,
since it enforces precision that does not exist in the gem command,
which is used to install gems in practice.

Even if the precision could be enforced, you wouldn’t want it,
since it would prevent people from using your library
with versions of its dependencies that are different
from the ones you used to develop the gem."

http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/

"When developing a gem, use the gemspec method in your Gemfile
to avoid duplication. In general, a gem's Gemfile should contain
the Rubygems source and a single gemspec line.

Do not check your Gemfile.lock into version control,
since it enforces precision that does not exist in the gem command,
which is used to install gems in practice.

Even if the precision could be enforced, you wouldn’t want it,
since it would prevent people from using your library
with versions of its dependencies that are different
from the ones you used to develop the gem."

http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
@lucasmazza
Copy link
Contributor

We have the lockfiles in the repo to share the result of bundle install across multiple travis builds to faster feedbacks when changing stuff. It's not a perfect solution at the moment (since we have to juggle with multiple lockfiles) but it's worth at the moment.

@lucasmazza lucasmazza closed this Aug 14, 2014
@josevalim
Copy link
Contributor

I have explicitly disagreed with Yehuda about this (and he knows ;)). The Gemfile.lock should stay in the repository because contributors and developers should be able to fork the project and run it using versions that are guaranteed to work.

If someone wants remove the "precision" which Yehuda mention, the best is to remove the lock file in the CI server, although that poses its own problems as @lucasmazza mentioned.

pre added a commit to AppGyver/sap-jwt-utils that referenced this pull request Aug 2, 2021
References why Gemfile.lock should be in the version control also for Rubygems:
* @josevalim heartcombo/devise#3147 (comment)
* @rafaelfranca rails/rails#18951 (comment)

Also Rails has Gemfile.lock in git:
* rails/rails@0ad6d27
pre added a commit to AppGyver/omniauth-sap-xsuaa that referenced this pull request Aug 2, 2021
References why Gemfile.lock should be in the version control also for Rubygems:
* @josevalim heartcombo/devise#3147 (comment)
* @rafaelfranca rails/rails#18951 (comment)

Also Rails has Gemfile.lock in git:
* rails/rails@0ad6d27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants