-
Notifications
You must be signed in to change notification settings - Fork 23
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
rbenv-bundler not caching bundle installation paths #12
Comments
What happens when you do your usual Bundler thing in a project and then |
That's the scenario I was trying to describe. |
What does your Bundler-controlled project's |
It doesn't have a |
It's created when you type |
But I don't use I verified that all the versions of gems that are installed when I type |
Did you upgrade Bundler itself, like in #7? |
Oh yes, I meant to put that in the original bug description but I forgot. I'm using ruby 1.9.2-p290 and bundler 1.1.3, which I believe is the latest. I reinstalled bundler today and that was the version I got. |
Ok, after thinking about it for a while, why should the cached paths file be modified? rbenv-bundler knows where to look already (excerpted from includes.sh):
Could you give an example where you install a system-level gem and it's not picked up by rbenv-bundler? |
Upon more investigation, this is actually the same issue as #7. However, updating to the very latest version of bundler doesn't fix the issue. I tried both the latest stable (1.1.3) and also Here's a console transcript so I won't be ambiguous in my description of what I'm seeing:
|
Alright, here's my theory. Issue #7 still doesn't apply here. The reason why you have been seeing this problem is that the current implementation of rbenv-bundler searches for a Bundler path. If not available, it simply quits and yields control back to the vanilla
and not the version specified in the
Since there's no |
Sure, I'll write up a patch to do this tomorrow. What is the use case for bundler where rbenv-bundler does work? (i.e. how does this "Bundler path" get created?) In any case, wouldn't |
Oh boy, now that I think of the issues, I don't know how deep this rabbit hole goes anymore. My proposal above is to separate rbenv-bundler's behavior into two cases:
As you can see, the above proposal is quite hacky and unsatisfactory. A more permanent solution might be to do lots of Bundler gem inspection on |
I would love to see rbenv-bundle work without Great work @carsomyr, I think that rbenv and bundler together (not gemsets) is on the path to the "simple" Ruby ecosystem of yesteryear. |
@developish, looking forward to a patch! |
Only if @cespare doesn't get to it first! |
Alright, I committed a fix in the |
Doesn't seem to work for me. Should the paths and manifests files have entries in them after I run |
You are supposed to see |
Also, make sure you visit a Bundler-controlled directory and run |
I just checked out the rehash branch and ran
|
Try running |
The initialization process is fixed! And it works (mostly)! Nice touch with the manifest files, I expected to have to It works with some of my existing projects, but one of my newer ones doesn't, and also newly created projects. To test this:
should return the entries in the manifest file, but returns empty. |
@developish, you'll have to type |
Alright guys, speak up about problems soon, because I'm fast-forwarding |
This just doesn't work for me. I blew away the
In I'll try to have another go at debugging this myself when I get a chance, but I'm pretty busy at the moment and getting this working isn't high on my own priority list. |
Alright, I think I figured out the problem: rbenv-bundler uses the incorrect assumption that the |
@carsomyr Nice, that is indeed the case! It works as expected after setting a local rbenv version. I assume it's not a difficult fix to look for the (Good job guessing at the problem btw.) |
Yeah, and it was a silly assumption to make, in retrospect. |
@cespare, @developish, this issue should be closed for good. Try testing the plugin again, this time with |
…pec manifests generated by the rehash.rb script The plugin now works regardless of whether "--path" is specified. This should resolve issue #12.
rbenv-bundler isn't working for me at all. I'm 99% sure everything is installed correctly (
rbenv bundler
shows the usage message, for instance).I traced the code and I can see that the
$cached_dirs_file
referred to inetc/rbenv.d/rehash/bundler.bash
is created but remains empty. It looks like the only way for entries to be put in that file (i.e. the only place that things are added to$cached_dirs
in this script) is the following (lines 51-53 ofetc/rbenv.d/rehash/bundler.bash
):However, the
get_bundle_path
function fails unless${1}/.bundle/config
exists. Hence, it doesn't seem like rbenv-bundler will do anything unless$RBENV_DIR/.bundle/config
exists. I don't have such a file. (On my machine, that would be~/.rbenv/.bundle/config
. I don't have a.bundle
directory in my rbenv installation folder. Should I?)Edit: Apologies for not including code; I couldn't figure out the intended behavior or I would have tried to fix it and make a pull request.
The text was updated successfully, but these errors were encountered: