Should i ignore gemfile.lock
Including your Gemfile. The one that can be pretty controversial is if you should check your Gemfile. The community view seems to have evolved on this over time. There are lots of differing opinions on this so I will try to give you an overview of the arguments about when to commit Gemfile. This also prevents this from happening in production on a new deploy or to a new production box.
Imagine if you spin up a new prod box because you are getting more traffic and it installs a newer version of some Gem. It would be difficult to track down why you were getting errors. You can and should specify versions of gems in your Gemfile but without the Gemfile.
Then nobody else will get to benefit from your work of checking that the updated Gems still work. You should check your Gemfile for updates frequently and bundle update where appropriate. This should include running the test suite after a bundle update but it inevitably requires running manual tests for critical functionality usually on development, then staging, then a final check-in production. Gotta be careful and make sure the app is really, really working. There is the famous Yehuda Katz article which urges you to not commit your Gemfile.
The Gemfile should have versions set and this should prevent problems, right? So two answers to the two parts of the question:. The same can be said for using a CI before a deploy which should be testing with a new bundle install on every run and thus get the same dependencies as a new developer would and find any bugs. This would theoretically sort out any problems but requires the tests to be complete raise your hand if you completely trust your tests. It looks like Rails is tracking the Gemfile.
I don't understand his reason. What if my gem depends on say Rails 3 and is not compatible with Rails 4? Sorry, something went wrong. Then you should specify a version string for Rails 3 in your Gemfile, while still leaving Gemfile. If you depend on certain version ranges of a gem to ensure compatibility, that belongs in Gemfile, not Gemfile.
Since the gem command only respects the dependency version constraints named in the gemspec, not Gemfile. Also, I'm commenting here because this issues shows up in Google search results. I understand that this issue and the gem development guide are several years old, and that although the gem-development directory contains a Gemfile.
I would gladly accept a patch here that improved the wording around this section, advocating for Gemfile. Skip to content. Star 1. New issue. Jump to bottom. A Gem's Gemfile.
Linked pull requests. Do not check in Gemfile. This loads the appropriate database adapter gem, based on your database. My workmates and I have different Gemfile.
We decide to remove Gemfile. Then before deploy it on server, we copy Gemfile. Python Javascript Linux Cheat sheet Contact. Should Gemfile.
0コメント