I like to vendor as many gems as possible, except those that must be built on each platform (libxml, etc.) but sometimes I like to use some bleeding-edge code rather than the gems that are out there on the gem servers.
Can I clone a github gem directly into vendor/gems. I guess I could, but will it affect my app code since it is already a git repository? I would like to just do periodic git pulls for these couple of gems so that I don’t have to update every gem and maybe break something.
Use of
vendor/gemshas been deprecated in favor of using Bundler andGemfileinstead. The vendor system had a number of flaws including a lack of support for compiled extensions, so it was never a complete solution.You’re better off locking your versions in the Gemfile as required. If you want to use bleeding edge versions, comment out the version declaration, remove
Gemfile.lockand do abundle installagain.It’s often the case that the published version of the gem has a flaw you need to repair by forking and fixing, so it’s easy to track this:
The advantage here is that the
Gemfileserves as documentation of what versions of the gems you require, and where to get them.vendor/gemsleaves people in the dark as to where that version came from.