This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2k
git ls-files
in gemspec template is bad practice.
#2287
Comments
Please try the prerelease of Bundler 1.3! It solves this problem by caching the result of evaluating the gemspec when you run |
Sounds good. Thanks. If I bundle package --all a git repo in Bundler 1.3, can it be used in production with Bundler 1.2? |
Yup. 1.3 rewrites the gemspecs, and 1.2 will just read them. |
dLobatog
added a commit
to dLobatog/hammer-cli-foreman
that referenced
this issue
Dec 17, 2013
git ls-files does not always give the right result, and installations from source might fail to build the gem properly because of this (see http://pastie.org/8557757). See the issues below for longer discussions on this: rodjek/rspec-puppet#111 rubygems/bundler#2287
johnnyshields
referenced
this issue
in simi/mongoid_paranoia
Jul 18, 2014
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Would it be possible to change the default gem.files line in the default gemspec template found here: https://github.com/carlhuda/bundler/blob/master/lib/bundler/templates/newgem/newgem.gemspec.tt
In my rails application, I frequently use gems in my Gemfile with a :git repository option, however my deployment/production systems do not have git and re-downloading the git tree every time is not desirable. I now rely on the latest version of Bundler's "bundle package -all" feature, where the git tree is packaged up nicely into vendor/cache/repo_name... I then commit that to my source control tree.
When a gemspec contains
git ls-files
, bundle install --deployment on the production system gives a fatal error because the git repository (.git directory) is not included in the packaged gem directory (created from the git checkout).Please refer to this issue here for a more detailed discussion:
savonrb/savon#380 (comment)
I run into this problem a lot with gems when using :git and :path options in my Gemfile in conjunction with "bundle package" and "bundle install --deployment". I am trying to start a better trend where people stop using
git ls-files
and other git commands in their gemspec because it wrongly assumes the consumer of the gem has access to git and the git repository during production.Thanks.
The text was updated successfully, but these errors were encountered: