-
-
Notifications
You must be signed in to change notification settings - Fork 2k
'bundle check' checks if gems are cached, not installed #162
Comments
In investigating this issue it may help to know that I find the following:
Then from the other direction:
So it appears that the check looks for a cached gem, then it looks for a specification, but it doesn't require in either case that the gem is installed under the gems directory. |
I can reproduce this. Make sure that you don't have rack-test installed in system gems. |
This is fixed on master. Please let me know if this works. |
I still see the same problem at commit fdb0f0c:
The check passes even when all the dependencies are expected. I guess this is what I would expect to happen:
|
FYI, I just updated my last comment with the correct error. I accidentally listed the error in my initial report (a Gem::Exception) but the current error is a LoadError as shown. |
That is not the same problem, and that is not a bug. When you run |
I may not have been clear in my explanation but this is the original issue I was
The problem is that right now if you're in project A and you install --without You can get around this in project B by doing 'bundle install', but the issue This issue will be solved if 'bundle check' in fact checks to see if the necessary Looking over my last comment, I did cheat on the demonstration regarding how this First what is correct:
Now what is amiss:
IMO this is a bug. If it's not then I think the documentation on 'bundle |
Thanks for your example. This is a bug, and should be fixed shortly. |
Should be working as of b5f28d6. |
Great, thanks! That fixes the issue. |
Whoops. I thought the fix worked but turns out I overlooked something important. At present check doesn't remember the --without. Here's what I currently get:
I expect the check should actually return satisfied because it should remember the --without flag. In project B the output is correct:
This is the right text but the exit status should probably be 1, not 0. This was some bad checking on my part, so I took the initiative to make a patch: bahuvrihi/bundler@4916626b1a620cfb566f4344ab0c7ca631915e3d The patch makes check remember the --without option and causes an exit code of 1 when the check fails. Note that 1) I just copy/pasted the without logic from Installer#run, so I'm not sure if it's the best thing to do and 2) something goes wonky when you merge this code with master. It works as a branch off of 0.9.11 but then one of the specs starts failing mysteriously when merged with 0.10.0.pre (d2c92e4). |
It appears that 'bundle check' only checks for cached gems when resolving dependencies. This cause false positives when you have multiple projects like so:
Project A:
Project B:
According to 'bundle check', the dependencies for project B are satisfied. I interpreted this to mean the dependencies are installed, but clearly they are not. I think the check should verify that the dependencies are actually installed and available, rather than just cached. Alternatively, there should be a way to check if the dependencies are installed without running a full 'bundle install'.
I found this on bundler-0.9.10
The text was updated successfully, but these errors were encountered: