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

bundle add should update vendor/cache #3309

Closed
benchristel opened this issue Oct 18, 2019 · 1 comment
Closed

bundle add should update vendor/cache #3309

benchristel opened this issue Oct 18, 2019 · 1 comment

Comments

@benchristel
Copy link

If I have previously vendored gems using bundle package, and I then bundle add a new gem, the new gem is not cached in vendor/cache. I'd expect bundle add to cache the new gem, because if I manually add the gem to the Gemfile and bundle install, it is cached.

Using bundler 2.0.1, Ruby 2.4.2

Thanks for considering this issue!

ghost referenced this issue in rubygems/bundler Nov 6, 2019
7393: Make 'bundle add' cache newly added gems when needed r=deivid-rodriguez a=andrehjr

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

The problem was that when calling `bundle add` with cache_all as true, I have to call an additional `bundle install` to vendor gems.

### What was your diagnosis of the problem?

My diagnosis was that a call to Bundler.load.cache was missing. For example Bundler::CLI::Update does the same after installing gems.

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

My fix was to call Bundler.load.cache when `Bundler.app_cache.exist? ` 

### Why did you choose this fix out of the possible options?

I chose this fix because it looks like this makes the behavior consistent with other commands.

I should also say that, as this is my first PR here, I'm not sure that this is the best solution, and it seems an easy fix for #7384. 

Co-authored-by: André Luis Leal Cardoso Junior <andrehjr@gmail.com>
deivid-rodriguez referenced this issue in rubygems/bundler Nov 7, 2019
7393: Make 'bundle add' cache newly added gems when needed r=deivid-rodriguez a=andrehjr

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

The problem was that when calling `bundle add` with cache_all as true, I have to call an additional `bundle install` to vendor gems.

### What was your diagnosis of the problem?

My diagnosis was that a call to Bundler.load.cache was missing. For example Bundler::CLI::Update does the same after installing gems.

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

My fix was to call Bundler.load.cache when `Bundler.app_cache.exist? `

### Why did you choose this fix out of the possible options?

I chose this fix because it looks like this makes the behavior consistent with other commands.

I should also say that, as this is my first PR here, I'm not sure that this is the best solution, and it seems an easy fix for #7384.

Co-authored-by: André Luis Leal Cardoso Junior <andrehjr@gmail.com>
(cherry picked from commit f83412a)
@hsbt hsbt transferred this issue from rubygems/bundler Mar 14, 2020
@deivid-rodriguez
Copy link
Member

This was fixed by rubygems/bundler#7393, but never closed!

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

No branches or pull requests

4 participants