Code Monkey home page Code Monkey logo

rbenv-bundler's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rbenv-bundler's Issues

Not Compatible with rbenv 0.4.0

Upgraded to rbenv 0.4.0 and doing rbenv rehash spits out the following error. rbenv-bundler has a hard dependency on rbenv version?

/usr/local/Cellar/rbenv-bundler/0.94/etc/rbenv.d/bundler/rehash.rb:331:in `ensure_capable_ruby': Could not locate a Ruby capable of running this script (RuntimeError)
        from /usr/local/Cellar/rbenv-bundler/0.94/etc/rbenv.d/bundler/rehash.rb:398
/usr/local/opt/rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:331:in `ensure_capable_ruby': Could not locate a Ruby capable of running this script (RuntimeError)
        from /usr/local/opt/rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:398

rbenv rehash fails with "undefined method `write' for #<Syck::Emitter:0x007f9eb92db338>"

I'm not sure if I'm doing something wrong, searching through the issues I couldn't find anything which would solve or at least explain the problem I'm having.

dains-macbook-pro:dain-personal-page dain$ rbenv local
1.9.2-p290
dains-macbook-pro:dain-personal-page dain$ rbenv global
1.9.3-p194
dains-macbook-pro:dain-personal-page dain$ which rake
/Users/dain/.rbenv/shims/rake
dains-macbook-pro:dain-personal-page dain$ rbenv which rake
/Users/dain/.rbenv/versions/1.9.2-p290/bin/rake
dains-macbook-pro:dain-personal-page dain$ rake -T
rake aborted!
You have already activated rake 10.0.2, but your Gemfile requires rake 0.9.6. Using bundle exec may solve this.
/Users/dain/Desktop/dain/workspace/dain-personal-page/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)
dains-macbook-pro:dain-personal-page dain$ rbenv rehash
/Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `end_document': undefined method `write' for #<Syck::Emitter:0x007f9eb92db338> (NoMethodError)
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `visit_Psych_Nodes_Document'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/visitors/visitor.rb:10:in `accept'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `block in visit_Psych_Nodes_Stream'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `each'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/visitors/emitter.rb:10:in `visit_Psych_Nodes_Stream'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/visitors/visitor.rb:11:in `accept'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/nodes/node.rb:36:in `to_yaml'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych.rb:166:in `dump'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/psych/core_ext.rb:13:in `psych_to_yaml'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `node_export'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `add'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck/rubytypes.rb:114:in `block (3 levels) in to_yaml'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck/rubytypes.rb:113:in `each'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck/rubytypes.rb:113:in `block (2 levels) in to_yaml'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck/rubytypes.rb:112:in `seq'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck/rubytypes.rb:112:in `block in to_yaml'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck.rb:401:in `call'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck.rb:401:in `emit'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck.rb:401:in `quick_emit'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck/rubytypes.rb:111:in `to_yaml'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/syck.rb:119:in `dump'
    from /Users/dain/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:116:in `gemspecs'
    from /Users/dain/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:208:in `block (3 levels) in rehash'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/pathname.rb:829:in `open'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/pathname.rb:829:in `open'
    from /Users/dain/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:207:in `block (2 levels) in rehash'
    from /Users/dain/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:190:in `each'
    from /Users/dain/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:190:in `block in rehash'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/pathname.rb:829:in `open'
    from /Users/dain/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/pathname.rb:829:in `open'
    from /Users/dain/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:189:in `rehash'
    from /Users/dain/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:410:in `<main>'

I'm on 10.7.5, no global Gems installed, using XCode command line tools, Homebrew, etc. and trying to get this working for an Octopress blog.

Thanks in advance for any pointers!

Schema / Groups

Should Groups belong to a specific User or should they be global?

i.e. will we ever want to expose a group to multiple users?

Doesn't work after upgrading to Ruby 3.1

I believe this has something to do with Psych 4.0.4 (ruby/psych#487 ?). Just changing rehash.rb line 256 to use #safe_load is not enough and I'm not sure which permitted_classes need to be specified (for me personally, YAML.safe_load(f, permitted_classes: [OpenStruct, Pathname]) worked).

Backtrace:

/home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/class_loader.rb:99:in `find': Tried to load unspecified class: OpenStruct (Psych::DisallowedClass)
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/class_loader.rb:28:in `load'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:424:in `resolve_class'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:213:in `visit_Psych_Nodes_Mapping'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `each_slice'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/visitor.rb:30:in `visit'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/visitor.rb:6:in `accept'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/jrs/.rbenv/versions/3.1.2/lib/ruby/3.1.0/psych.rb:335:in `safe_load'
        from /home/jrs/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:265:in `block in build_ruby_profiles'
        from /home/jrs/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:264:in `open'
        from /home/jrs/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:264:in `open'
        from /home/jrs/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:264:in `build_ruby_profiles'
        from /home/jrs/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:460:in `<main>'

Perhaps related?

❯ rbenv version
3.1.2 (set by /home/jrs/testdir/.ruby-version)
❯ ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
❯ rbenv bundler on
rbenv: ruby: command not found

The `ruby' command exists in these Ruby versions:
  3.1.2

Issue created by mistake

Accidentally typed in my browser window and github decided that I wanted to create an issue here, sorry.

casuses rehash to crash if no Gemfile

When issuing rbenv rehash when the bundler plugin is installed from a directory that doesn't have a Gemfile a stack trace is printed:

/usr/local/var/rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.9.4/lib/bundler/dsl.rb:40:in `rescue in eval_gemfile': There was an error in your Gemfile, and Bundler cannot continue. (Bundler::GemfileError)
    from /usr/local/var/rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.9.4/lib/bundler/dsl.rb:32:in `eval_gemfile'
    from /usr/local/var/rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.9.4/lib/bundler/dsl.rb:10:in `evaluate'
    from /usr/local/var/rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/bundler-1.9.4/lib/bundler/definition.rb:25:in `build'
    from /usr/local/Cellar/rbenv-bundler/0.99/etc/rbenv.d/bundler/rehash.rb:95:in `gemspecs'
    from /usr/local/Cellar/rbenv-bundler/0.99/etc/rbenv.d/bundler/rehash.rb:202:in `block (2 levels) in rehash'
    from /usr/local/Cellar/rbenv-bundler/0.99/etc/rbenv.d/bundler/rehash.rb:190:in `each'
    from /usr/local/Cellar/rbenv-bundler/0.99/etc/rbenv.d/bundler/rehash.rb:190:in `block in rehash'
    from /usr/local/Cellar/rbenv-bundler/0.99/etc/rbenv.d/bundler/rehash.rb:189:in `open'
    from /usr/local/Cellar/rbenv-bundler/0.99/etc/rbenv.d/bundler/rehash.rb:189:in `open'
    from /usr/local/Cellar/rbenv-bundler/0.99/etc/rbenv.d/bundler/rehash.rb:189:in `rehash'
    from /usr/local/Cellar/rbenv-bundler/0.99/etc/rbenv.d/bundler/rehash.rb:470:in `<main>'

Please don't rebase or amend the master branch

Hi Roy,

I find that I regularly get merge problems on master when pulling into unmodified clones of this repository. It appears that this repository's master branch is regularly being rebased, or is otherwise subjected to git history modification such as via git commit --amend. Please don't modify the master branch's history; it's very problematic for anyone who tracks your repository. In my case, I've added rbenv-bundler to the repos being installed and updated by rbenv-installer as part of an automated workflow. This continually breaks with explicit merges and/or conflicts being reported for what should be fast-forward merges.

Pro Git has a nice explanation of the problems introduced by rebasing public branches. This explanation applies to all forms of git history modification, including amend.

For example, a clone made around July 26th shows this history:

* 130934f  (8 days)     <Roy Liu>         (HEAD, 0.94, master) Make minor organizational changes
* cb0d4a2  (9 days)     <Roy Liu>         Update the RbenvBundler#ensure_capable_ruby method so that it no longer claims JRuby 1.9.x as capable when it's not (lack of Kernel.fork)
* 235d5a3  (11 days)    <Roy Liu>         Update the README
* d419591  (11 days)    <Roy Liu>         Fix code related to the corner cases when either the manifest.txt file doesn't exist or the ruby_profiles.yml file is first created
* 41fd6ea  (11 days)    <Roy Liu>         Improve error handling for forked child processes
* dea9cde  (13 days)    <Roy Liu>         Add the .yardopts file
* 3aac2e5  (3 weeks)    <Roy Liu>         Make minor organizational changes
* a0c3d8b  (8 weeks)    <Roy Liu>         (0.93) Check the recency of the ~/.rbenv/versions directory instead of rbenv Ruby directories to determine if Rubies have been added or removed.

Compare that to a clone made as of this writing (July 31st):

* 970bfef  (8 days)     <Roy Liu>         (HEAD, 0.94, origin/master, origin/HEAD, master) Make minor organizational changes
* cb0d4a2  (9 days)     <Roy Liu>         Update the RbenvBundler#ensure_capable_ruby method so that it no longer claims JRuby 1.9.x as capable when it's not (lack of Kernel.fork)
* 235d5a3  (11 days)    <Roy Liu>         Update the README
* d419591  (11 days)    <Roy Liu>         Fix code related to the corner cases when either the manifest.txt file doesn't exist or the ruby_profiles.yml file is first created
* 41fd6ea  (11 days)    <Roy Liu>         Improve error handling for forked child processes
* dea9cde  (13 days)    <Roy Liu>         Add the .yardopts file
* 3aac2e5  (3 weeks)    <Roy Liu>         Make minor organizational changes
* a0c3d8b  (8 weeks)    <Roy Liu>         (0.93) Check the recency of the ~/.rbenv/versions directory instead of rbenv Ruby directories to determine if Rubies have been added or removed.

The commit id for the most recent commit has changed; the two histories have diverged and are no longer cleanly mergable.

FWIW, what I do on my public repos is to follow a simple GitHub Flow style of work:

  1. Interim work goes on a descriptively named local branch
  2. When that stabilizes a bit, I'll rebase to clean up the history then push it to GitHub.
  3. I use hub to create a pull request (git pull-request) from that branch.
  4. I'll merge that work via GitHub's Pull Request UI.

This lets me play around quite a lot on the branches, including rebasing, amending, etc. without disturbing master's history. Sometimes I'll even let a branch or pull request sit for a bit while I think about it.. sometimes I'll throw it away without merging. Then no one tracking master had to worry about that little hiccup...

Have to run bundle exec anyway with gem path:

Hey,

I don't know if I am doing something wrong, but I have to run bundle exec rackup and bundle exec ruby test\test.rb for them to work with a gem I am working on that is linked using :path in Gemfile:

gem 'test', path '../test'

Please advise.

support for md5 checksum on NetBSD

Please apply the following diff:

diff --git a/etc/rbenv.d/bundler/includes.sh b/etc/rbenv.d/bundler/includes.sh
index b8ddb51..234d836 100644
--- a/etc/rbenv.d/bundler/includes.sh
+++ b/etc/rbenv.d/bundler/includes.sh
@@ -148,7 +148,7 @@ function md5 {
return -- $?
;;

  •    Darwin|FreeBSD)
    
  •    Darwin|FreeBSD|NetBSD)
         echo "$1" | command -- md5
         return -- $?
         ;;
    

Getting Bundler error message "Could not find rake-10.1.1 in any of the sources" for multiple commands

I just installed Ruby 2.1.1 using rbenv 0.4.0 and rbenv-gemset 0.5.4. Then, I installed rbenv-bundler 0.97 and started getting the error message below.

Running any of the following commands:

bundle install
bundle update
rbenv rehash
rbenv bundler on
rbenv bundler off

gives me the following error message:

Bundler gave the error "Could not find rake-10.1.1 in any of the sources" while
processing "/Users/jlamberg/projects/foobar/foobar-webapp/Gemfile". Perhaps
you forgot to run "bundle install"?

For the regular Bundler commands I get first the usual output telling me everything went all right. It is then followed by the above error message.

Removing rbenv-bundler makes the error message go away.

Ruby came with Rake 10.1.0, by default, and installing Rails 4.0.4 installed Rake 10.1.1, if that's any help.

Anyone else having the same problem? Is there something I should have done differently?

My environment is:

Mac OS X 10.8.5

I used Homebrew to install these:
rbenv 0.4.0
rbenv-gemset 0.5.4
rbenv-bundler 0.97

Bundler 1.5.3
Ruby 2.1.1 (2014-02-24 patchlevel 76) [x86_64-darwin12.0]
Rubygems 2.2.2
GEM_HOME /Users/jlamberg/.rbenv/versions/2.1.1/gemsets/foobar-webapp
GEM_PATH /Users/jlamberg/.rbenv/versions/2.1.1/gemsets/foobar-webapp:/Users/jlamberg/.rbenv/versions/2.1.1/gemsets/global:/Users/jlamberg/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0

The output of bundle env can be found at https://gist.github.com/jlamberg/9649419.

Bundled gems commands aren't found with bundler >= 1.2.0

With bundler 1.1.5 the executable files in my gems installed with bundler in vendor/bundle are found by rbenv-bundle when I do :

rbenv which rails

I can see the proper path showing.

But with bundler 1.2.0 or 1.2.1 it invariably returns :

rbenv: rails: command not found

(not just for rails but for any command in a gem)

My OS is an Ubuntu Linux.

`rbenv rehash` fails with exception in Bundler load_spec_files

rbenv rehash no longer works for me after upgrading to the latest (bc8bcd9). If I roll back to dd0073e everything works fine. So it seems a problem was introduced along with the new rehash.rb script.

I've completely deleted ~/.rbenv/plugins/rbenv-bundler/share/rbenv/bundler/, and that didn't help.

Basically, rbenv rehash works for a while, but then at some point I'm guessing the manifest gets corrupted. At this point even the most trivial project causes it to crash.

$ mkdir test
$ cd test/
$ rbenv local 1.9.3-p125 
$ bundle init
Writing new Gemfile to /Users/mbrictson/Desktop/test/Gemfile
$ echo "gem 'rack'" >> Gemfile
$ bundle
Fetching gem metadata from https://rubygems.org/..
Installing rack (1.4.1) 
Using bundler (1.1.3) 
Your bundle is complete! It was installed into ./.bundle/bundle
$ rbenv rehash
/Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:574:in `rescue in load_spec_files': git://github.com/55minutes/validate-website.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:572:in `load_spec_files'
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:372:in `local_specs'
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:557:in `specs'
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/lazy_specification.rb:53:in `__materialize__'
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/spec_set.rb:86:in `block in materialize'
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/spec_set.rb:83:in `map!'
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/spec_set.rb:83:in `materialize'
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:127:in `specs'
    from /Users/mbrictson/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/environment.rb:27:in `specs'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:104:in `gemspecs'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:213:in `block (3 levels) in rehash'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:212:in `open'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:212:in `open'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:212:in `block (2 levels) in rehash'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:173:in `each'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:173:in `block in rehash'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:172:in `open'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:172:in `open'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:172:in `rehash'
    from /Users/mbrictson/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:279:in `<main>'

According to the error, somehow rehash is convinced that git://github.com/55minutes/validate-website.git should be part of this projects bundle, but it clearly is not.

$ bundle show
Gems included by the bundle:
  * bundler (1.1.3)
  * rack (1.4.1)

rake rbenv: bundle: command not found

I installed rbenv-bundler using homebrew.

My gems are installed in vendor/bundle.

when I call rake I get:

» rake
rbenv: bundle: command not found
> rbenv which rake
/Users/rege/Code/app/vendor/bundle/gems/rake-10.1.0/bin/rake
RubyGems Environment:
  - RUBYGEMS VERSION: 2.1.10
  - RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin13.0.0]
  - INSTALLATION DIRECTORY: /Users/rege/.gem
  - RUBY EXECUTABLE: /usr/local/rbenv/versions/2.0.0-p247/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/rege/.gem/bin
  - SPEC CACHE DIRECTORY: /Users/rege/.gem/specs
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-13
  - GEM PATHS:
     - /Users/rege/.gem

little readme

Hello Roy!

Could you please write small README outlining how it install this thing?
I cannot figure out how to use it.

Ruslan.

Reorganize repo

Any chance you could reorganize the repo so it can be easily extracted/cloned straight in to the plugins directory? So the bin and etc folders would be at the top level. Would no longer need an install script either.

don't force push all the time

It would be cool if you wouldn't force push all the time, this really makes the plugin close to unusable.

From github.com:carsomyr/rbenv-bundler
 + e9c39d3...bc8bcd9 master     -> origin/master  (forced update)

RBENV-doctor warning: "rbenv-bundler is considerd harmful"

Hi,
After installing rbenv-bundler without obvious issues, I ran the so-called rbenv-doctor script and it gave me a warning:
"rbenv-bundler is considered harmful. Please remove the plugin..."

Please forgive me if I am describing a known issue: but I did not see any warning in HomeBrew/Git about any issues between rbenv and rbenv-bundler.

Up until installing rbenv-bundler I had no problem with rbenv, or anything else with ruby.
The rbenv-doctor script is described here:
"https://github.com/rbenv/rbenv-installer/blob/main/bin/rbenv-doctor"
The script is:
"curl -fsSL https://github.com/rbenv/rbenv-installer/raw/main/bin/rbenv-doctor | bash"
The rbenv-bundler plug-in warning is initiated at line 205 in the code.

Before I installed rebenv-bunder the rbenv-doctor reported all was OK:
$ Checking for rbenv' in PATH: /usr/local/bin/rbenv $ Checking for rbenv shims in PATH: OK $ Checking rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20220825)
$ Counting installed Ruby versions: 1 versions
$ Checking RubyGems settings: OK
$ Auditing installed plugins: OK"

But after installing rbenv-bunder, it was the same except for the plug-in warning at last line:
"Note: do not install rbenv-bundler
$ Auditing installed plugins: warning
$ rbenv-bundler is considered harmful. Please remove the plugin and `rm -rf $(rbenv root)/shims && rbenv rehash'."

After removing rbenv-bundler, the rbenv-doctor script gave the same message as at first: "all OK".

I am pretty new to ruby, and normally just use HomeBrew and Github to download things.
I tried to look at what might be the issue, but nothing was obvious.

Forgve me for stating the obvious, but to me, it sems there is either a problem with rbenv-bundler, or else the developers of rbenv need to update their doctor script.

In any event, until this is cleared up, it seems there should be a notice in rbenv-bundler about this.

Can't seem to get working

Per the README, I did a git clone into my rbenv directory:

$ git clone -- [email protected]:carsomyr/rbenv-bundler ~/.rbenv/plugins/bundler

...but a rbenv commands does not show "bundler". I'm assuming that means something is not working right.

I'm pretty new to all this arcane ruby environment wrangling, so apologies if I've overlooked something obvious.

Not working if no path is specified

In the instructions, you say to run: $ bundle install --path vendor/local

It seems silly to require a custom path -- are there technical reasons not to just use the default $GEM_HOME if no path is specified. I'd be happy to work on a patch for this, but I just wanted to check with you first and see if I'm missing something.

Thanks,
Simon

rbenv-bundler slowing down rbenv rehash

$ rbenv bundler on
$ time rbenv rehash

real    0m1.996s
user    0m1.533s
sys 0m0.437s
$ rbenv bundler off
$ time rbenv rehash

real    0m0.196s
user 0m0.092s
sys 0m0.095s

Its taking about 10 times more, slowing my bash initialization to a crawl.
The strange thing here was that it was complaining about a missing gem on a Gemfile that had nothing to do with my current directory. Ill try to reproduce this.

error with "rbenv rehash"

Note: As of version 0.96, you will no longer need to type rbenv rehash after bundle install or bundle update, as the plugin will automagically rehash for you. Still, it's good practice to not rely on magic and type rbenv rehash upon installation of gems with executables.

But when I did type this, as I always have in past, I get this:

/Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:93:in gemspecs': undefined methodrefresh' for #Bundler::RubygemsIntegration::Future:0x007f979b025550 (NoMethodError)

so should I ignore this and just stop typing rbenv rehash? Since you say above its not necessary but type it anyway, this is confusing.

/Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:93:in gemspecs': undefined methodrefresh' for #Bundler::RubygemsIntegration::Future:0x007f979b025550 (NoMethodError)
from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:206:in block (3 levels) in rehash' from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:205:inopen'
from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:205:in open' from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:205:inblock (2 levels) in rehash'
from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:188:in each' from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:188:inblock in rehash'
from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:187:in open' from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:187:inopen'
from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:187:in rehash' from /Users/lori/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:464:in

'

rbenv rehash fails with fresh install of rbenv & rbenv-bundler on OSX Lion

Many many thanks for this tool! I'm unable to get this up & running on a fresh OSX install:

~/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:343:in `ensure_capable_ruby': Could not locate a Ruby capable of running this script (RuntimeError)
    from ~/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:410

Last worked in SHA: 059d756.

Any tips?

Deleting a ruby version causes rehash to error due to ruby_profiles.yml being out of sync

I am using ruby-build and when I delete a ruby version, ruby_profiles.yml gets out of sync and will error when running rbenv rehash:

c@c:~/project$ rbenv rehash
/home/c/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:343:in `ensure_capable_ruby': undefined method `ruby_version' for nil:NilClass (NoMethodError)
from /home/c/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:342:in `select'
from /home/c/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:342:in `ensure_capable_ruby'
from /home/c/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:396

If you just compare against the mtime of the versions directory at RbenvBundler.build_ruby_profiles that should detect if a folder/ruby version has been added/deleted.

rbenv-bundler not caching bundle installation paths

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 in etc/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 of etc/rbenv.d/rehash/bundler.bash):

if { get_bundle_path "$RBENV_DIR" > /dev/null; } then
    cached_dirs="${cached_dirs}${RBENV_DIR}"$'\n'
fi

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.

Unfortunately not working with rbenv 0.4.0

$ rbenv version
2.0.0-p247 (set by /Users/blablabla/.ruby-version)
$ rbenv rehash
$ rbenv which unicorn
/Users/t3hk0d3/.rbenv/versions/2.0.0-p247/bin/unicorn
$ ls -lha `rbenv which unicorn`
-rwxr-xr-x  1 t3hk0d3  staff   462B Mar 19 18:46 /Users/t3hk0d3/.rbenv/versions/2.0.0-p247/bin/unicorn
$ rbenv bundler on
$ unicorn
bundler: command not found: unicorn
Install missing gem executables with `bundle install`
$ rbenv bundler off
$ unicorn
I, [2014-03-20T19:31:20.948909 #24817]  INFO -- : listening on addr=0.0.0.0:8080 fd=9
I, [2014-03-20T19:31:20.949021 #24817]  INFO -- : worker=0 spawning...
I, [2014-03-20T19:31:20.949938 #24817]  INFO -- : master process ready
I, [2014-03-20T19:31:20.951025 #24881]  INFO -- : worker=0 spawned pid=24881
I, [2014-03-20T19:31:20.951494 #24881]  INFO -- : Refreshing Gem list
/Users/t3hk0d3/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/runtime.rb:34:in `block in setup': You have already activated raindrops 0.11.0, but your Gemfile requires raindrops 0.10.0. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
$ bundle exec unicorn
I, [2014-03-20T19:37:29.837977 #26224]  INFO -- : listening on addr=0.0.0.0:8080 fd=9
I, [2014-03-20T19:37:29.838097 #26224]  INFO -- : worker=0 spawning...
I, [2014-03-20T19:37:29.839355 #26224]  INFO -- : master process ready
I, [2014-03-20T19:37:29.840628 #26291]  INFO -- : worker=0 spawned pid=26291
I, [2014-03-20T19:37:29.841167 #26291]  INFO -- : Refreshing Gem list
I, [2014-03-20T19:38:06.322937 #26291]  INFO -- : worker=0 ready

rbenv rehash throws error after cloning rbenv-bundler

I have setup rbenv and it is working correctly. I have the bundler gem installed and ran rbenv rehash. All appears to be working great. I install rbenv-bundler as a plugin and then run rbenv rehash. The following is the error I receive.

andres@virtualbox:~$ rbenv rehash
/home/andres/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:316:in block (2 levels) in build_ruby_profiles': undefined methodsplit' for nil:NilClass (NoMethodError)
from /home/andres/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:307:in popen' from /home/andres/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:307:inblock in build_ruby_profiles'
from /home/andres/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:296:in map' from /home/andres/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:296:inbuild_ruby_profiles'
from /home/andres/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:388:in `

'

I installed ruby 1.9.3-p194.

JRuby support

I didn't checked the source yet but fork isn't supported by jruby:

$ rbenv rehash
NotImplementedError: fork is not available on this platform
        fork at org/jruby/RubyProcess.java:965
  __ensure__ at /Users/sobrinho/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:133
    gemspecs at /Users/sobrinho/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:129
      rehash at /Users/sobrinho/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:246
        open at org/jruby/RubyIO.java:1139
        open at /Users/sobrinho/.rbenv/versions/jruby-1.6.7.2/lib/ruby/1.9/pathname.rb:829
      rehash at /Users/sobrinho/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:245
        each at org/jruby/RubyHash.java:1186
      rehash at /Users/sobrinho/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:226
        open at org/jruby/RubyIO.java:1139
        open at /Users/sobrinho/.rbenv/versions/jruby-1.6.7.2/lib/ruby/1.9/pathname.rb:829
      rehash at /Users/sobrinho/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:225
      (root) at /Users/sobrinho/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:410

Issue with psych/ostruct under Ruby 2.3

Starting to play with Ruby 2.3 and running into a bit of a mess with rbenv-bundler:

$ rbenv bundler on
/home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/ostruct.rb:175:in `respond_to_missing?': undefined method `key?' for nil:NilClass (NoMethodError)
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:380:in `respond_to?'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:380:in `init_with'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:373:in `revive'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:207:in `visit_Psych_Nodes_Mapping'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/visitor.rb:15:in `visit'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/visitor.rb:5:in `accept'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:31:in `accept'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:337:in `block in revive_hash'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:335:in `each'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:335:in `each_slice'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:335:in `revive_hash'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/visitor.rb:15:in `visit'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/visitor.rb:5:in `accept'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:31:in `accept'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:310:in `visit_Psych_Nodes_Document'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/visitor.rb:15:in `visit'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/visitor.rb:5:in `accept'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/visitors/to_ruby.rb:31:in `accept'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych/nodes/node.rb:37:in `to_ruby'
    from /home/mwp/.rbenv/versions/2.3.0-preview2/lib/ruby/2.3.0/psych.rb:252:in `load'
    from /home/mwp/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:267:in `block in build_ruby_profiles'
    from /home/mwp/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:266:in `open'
    from /home/mwp/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:266:in `open'
    from /home/mwp/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:266:in `build_ruby_profiles'
    from /home/mwp/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:455:in `<main>'

Everything was working fine under Ruby 2.2.3! Not sure where to begin with this. Using the latest release of Bundler and current head of rbenv and rbenv-bundler.

1.8 Compatibility

The latest does not appear to be compatible with 1.8, firstly due to differences in the method signature for IO#popen between 1.8 and 1.9 (1.8's does not include any of the fancy array param/options hash).

I've made a patch at an initial attempt to fix this issue, but rbenv rehash now seems to be simply not doing anything as far as the bundled gems go (ree-1.8.7-2011.12 / rubygems-1.5.3 / bundler-1.1.3)

rbenv rehash extremely slow when rbenv-bundler is enabled

I looked at issue #20, and that didn't seem to fix my problem.

Whenever I run rbenv rehash with rbenv-bundler enabled, it takes between 20-40 seconds, even with NO gems installed whatesoever.

If i disable the plugin or completely remove it, rehashing takes at most 11 seconds.

I am on Mac OS X, using ZSH, on ruby 1.9.3-p327

Bundle command search in all rubies installations in 2 environments

Bundle command search in all rubies installations when use one ruby in global and other in local.

Steps

  1. Install rbenv-bundler
  2. Install 2 rubies with rbenv (2.0.0pxxx and jruby-1.7.2)
  3. Set global one of them (2.0.0pxxx)
  4. Move to your protect folder
  5. Set local the other one (jruby-1.7.2)
  6. At this steps the bug is installed, you can reproduce if you run
  7. rbenv rehash
    • In terminal prints twice the result
  8. bundle install
    • The bundler install dependencies for jruby and then search the dependence in 2.0.0pxxx and shows crazy messages.

I uninstall the rbenv-bundler for now.

Please deprecate this whole project

This plugin seems to be popular, presumably because people think they will need it if they use rbenv and Bundler. Yes, it can free users from having to type bundle exec or bin/* to reach the executables for their project, but the tradeoff (never mentioned in the documentation) is that the rehash process is slow, and a detrimental effect to people's whole experience with rbenv in general.

Edit: more issues popping up, documenting here for posterity

I want to be able to simply write rake or rspec in my Ruby project just as much as the next person, without bundle exec or the like, but I firmly believe this plugins approach is flawed which is evident by the number of problems people with it, poor rbenv rehash performance and the sheer amount of code necessary for it to work.

I've updated our wiki to warn against this plugin, and suggested that people simply use bundle install --binstubs and use bin/* for their executables or add ./bin to their PATH. (Yes, this approach has potential security flaws which we're discussing, but at least it works consistently and in a simple manner.)

I would like that this project deprecates itself, by putting up a notice in the documentation about the negative consequences of using the plugin, and by pushing an update that prints out a similar warning to STDERR any time someone does rbenv rehash or invokes a rbenv-bundler-generated binstub. The project's documentation could also suggest alternative solutions for avoiding bundle exec, such as Bundler's --binstubs.

Missing manifest.txt causes NoMethodError

I checked out the latest version and ran bundle install within my project directory:

cat: /Users/chris/.rbenv/plugins/bundler/share/rbenv/bundler/manifest.txt: No such file or directory
cat: /Users/chris/.rbenv/plugins/bundler/share/rbenv/bundler/manifest.txt: No such file or directory
    ...

Right after I tried rbenv rehash, which resulted in:

/Users/chris/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:233:in `block (2 levels) in rehash': undefined method `[]' for    #<File:0x007fdb7382ef28> (NoMethodError)
    from /Users/chris/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:226:in `each'
    from /Users/chris/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:226:in `block in rehash'
    from /Users/chris/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:225:in `open'
    from /Users/chris/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:225:in `open'
    from /Users/chris/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:225:in `rehash'
    from /Users/chris/.rbenv/plugins/bundler/etc/rbenv.d/bundler/rehash.rb:410:in `<main>'

The issue was fixed by touch /Users/chris/.rbenv/plugins/bundler/share/rbenv/bundler/manifest.txt.

Shouldn't be the file created when it doesn't exist?

`rbenv rehash` gives error "rbenv: ruby: command not found"

I recently installed v0.95 and rbenv rehash gives me an error:

rbenv: ruby: command not found

The `ruby' command exists in these Ruby versions:
  1.9.3-p362

Prior to cloning your plugin, rehash worked. If I turn rbenv-bundler off, rehash gives no error. If I turn it back on, I get:

rbenv: ruby: command not found

The `ruby' command exists in these Ruby versions:
  1.9.3-p362

rbenv: ruby: command not found

The `ruby' command exists in these Ruby versions:
  1.9.3-p362

I copied the the file "etc/rbenv.d/bundler/rehash.rb" from the commit from Dec 12 (b29cdeb) into my local and rehash gave no errors.

Problem with binstubs when Bundler gem from local git repo

I have installed a gem from a local git repository using bundler's local installation option. However, during installation bundler complained:

Using beaker-vcloud 0.2.0 from puppetlabs/beaker-vcloud (at ~/Projects/beaker-vcloud@0c2fa2b)
`~/Projects/beaker-vcloud/bin/beaker` does not exist, maybe `gem pristine beaker-vcloud` will fix it?

Now, $ bundle exec beaker works, ~/.rbenv/shims/beaker exists, but $ beaker results "rbenv: beaker: command not found". I have re-hashed. I believe this may be an issue with gem, but I don't know enough about its inner workings to check.

Likely the original cause of the $ bundle pristine message that led to rubygems/bundler#6585

~/.rbenv/shims/beaker-vcloud does not exist.

Note, this seems like the source of the bug:

+++ [includes.sh:56] gemspec_entries='rake
...
beaker
~/Projects/beaker-vcloud/bin

Which is written from

f.write(gemspec.bin_dir + "\n")
This indicates to me a problem with gem's bin_dir() https://docs.ruby-lang.org/en/trunk/Gem/Specification.html#method-i-bin_dir

Which has this cryptic TODO message attached: https://github.com/rubygems/rubygems/blob/90cb64dd0fad27fb0b55466a58a26609b5af34e5/lib/rubygems/specification.rb#L1578

def bin_dir
  @bin_dir ||= File.join gem_dir, bindir # TODO: this is unfortunate
end

From --debug output:

beaker $ rbenv --debug exec beaker
+ [rbenv:23] enable -f /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv-realpath.dylib realpath
+ [rbenv:53] '[' -z '' ']'
+ [rbenv:54] RBENV_ROOT=~/.rbenv
+ [rbenv:58] export RBENV_ROOT
+ [rbenv:60] '[' -z '' ']'
+ [rbenv:61] RBENV_DIR=~/Projects/beaker
+ [rbenv:67] export RBENV_DIR
+ [rbenv:70] shopt -s nullglob
++ [rbenv:72] abs_dirname /usr/local/bin/rbenv
+++ [rbenv:25] realpath /usr/local/bin/rbenv
++ [rbenv:25] local path=/usr/local/Cellar/rbenv/1.1.1/libexec/rbenv
++ [rbenv:26] echo /usr/local/Cellar/rbenv/1.1.1/libexec
+ [rbenv:72] bin_path=/usr/local/Cellar/rbenv/1.1.1/libexec
+ [rbenv:76] export PATH=/usr/local/Cellar/rbenv/1.1.1/libexec:~/.rbenv/shims:~/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/puppetlabs/bin:/usr/local/munki
+ [rbenv:76] PATH=/usr/local/Cellar/rbenv/1.1.1/libexec:~/.rbenv/shims:~/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/opt/puppetlabs/bin:/usr/local/munki
+ [rbenv:78] RBENV_HOOK_PATH=:~/.rbenv/rbenv.d
+ [rbenv:79] '[' /usr/local/Cellar/rbenv/1.1.1 '!=' ~/.rbenv ']'
+ [rbenv:81] RBENV_HOOK_PATH=:~/.rbenv/rbenv.d:/usr/local/Cellar/rbenv/1.1.1/rbenv.d
+ [rbenv:83] RBENV_HOOK_PATH=:~/.rbenv/rbenv.d:/usr/local/Cellar/rbenv/1.1.1/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks
+ [rbenv:87] RBENV_HOOK_PATH=~/.rbenv/rbenv.d:/usr/local/Cellar/rbenv/1.1.1/rbenv.d:/usr/local/etc/rbenv.d:/etc/rbenv.d:/usr/lib/rbenv/hooks
+ [rbenv:88] export RBENV_HOOK_PATH
+ [rbenv:90] shopt -u nullglob
+ [rbenv:93] command=exec
+ [rbenv:94] case "$command" in
++ [rbenv:107] command -v rbenv-exec
+ [rbenv:107] command_path=/usr/local/Cellar/rbenv/1.1.1/libexec/rbenv-exec
+ [rbenv:108] '[' -n /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv-exec ']'
+ [rbenv:110] shift 1
+ [rbenv:111] '[' beaker = --help ']'
+ [rbenv:118] exec /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv-exec beaker
+ [rbenv-exec:20] '[' beaker = --complete ']'
++ [rbenv-exec:24] rbenv-version-name
+ [rbenv-version-name:6] '[' -z '' ']'
++ [rbenv-version-name:7] rbenv-version-file
+ [rbenv-version-file:7] target_dir=
+ [rbenv-version-file:22] '[' -n '' ']'
+ [rbenv-version-file:25] find_local_version_file ~/Projects/beaker
+ [rbenv-version-file:10] local root=~/Projects/beaker
+ [rbenv-version-file:11] [[ ~/Projects/beaker =~ ^//[^/]*$ ]]
+ [rbenv-version-file:12] '[' -e ~/Projects/beaker/.ruby-version ']'
+ [rbenv-version-file:13] echo ~/Projects/beaker/.ruby-version
+ [rbenv-version-file:14] return 0
+ [rbenv-version-name:7] RBENV_VERSION_FILE=~/Projects/beaker/.ruby-version
++ [rbenv-version-name:8] rbenv-version-file-read ~/Projects/beaker/.ruby-version
+ [rbenv-version-file-read:6] VERSION_FILE=~/Projects/beaker/.ruby-version
+ [rbenv-version-file-read:8] '[' -e ~/Projects/beaker/.ruby-version ']'
+ [rbenv-version-file-read:11] IFS='
'
+ [rbenv-version-file-read:12] words=($(cut -b 1-1024 "$VERSION_FILE"))
++ [rbenv-version-file-read:12] cut -b 1-1024 ~/Projects/beaker/.ruby-version
+ [rbenv-version-file-read:13] version=2.5.1
+ [rbenv-version-file-read:15] '[' -n 2.5.1 ']'
+ [rbenv-version-file-read:16] echo 2.5.1
+ [rbenv-version-file-read:17] exit
+ [rbenv-version-name:8] RBENV_VERSION=2.5.1
+ [rbenv-version-name:11] OLDIFS='
'
+ [rbenv-version-name:12] IFS='
'
+ [rbenv-version-name:12] scripts=(`rbenv-hooks version-name`)
++ [rbenv-version-name:12] rbenv-hooks version-name
+ [rbenv-hooks:9] '[' version-name = --complete ']'
+ [rbenv-hooks:18] RBENV_COMMAND=version-name
+ [rbenv-hooks:19] '[' -z version-name ']'
+ [rbenv-hooks:24] enable -f /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv-realpath.dylib realpath
+ [rbenv-hooks:55] IFS=:
+ [rbenv-hooks:55] hook_paths=($RBENV_HOOK_PATH)
+ [rbenv-hooks:57] shopt -s nullglob
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:63] shopt -u nullglob
+ [rbenv-version-name:13] IFS='
'
+ [rbenv-version-name:18] '[' -z 2.5.1 ']'
+ [rbenv-version-name:18] '[' 2.5.1 = system ']'
+ [rbenv-version-name:28] version_exists 2.5.1
+ [rbenv-version-name:24] local version=2.5.1
+ [rbenv-version-name:25] '[' -d ~/.rbenv/versions/2.5.1 ']'
+ [rbenv-version-name:29] echo 2.5.1
+ [rbenv-exec:24] RBENV_VERSION=2.5.1
+ [rbenv-exec:25] RBENV_COMMAND=beaker
+ [rbenv-exec:27] '[' -z beaker ']'
+ [rbenv-exec:32] export RBENV_VERSION
++ [rbenv-exec:33] rbenv-which beaker
+ [rbenv-which:14] '[' beaker = --complete ']'
+ [rbenv-which:30] RBENV_COMMAND=beaker
+ [rbenv-which:32] '[' -z beaker ']'
+ [rbenv-which:37] RBENV_VERSION=2.5.1
+ [rbenv-which:39] '[' 2.5.1 = system ']'
+ [rbenv-which:43] RBENV_COMMAND_PATH=~/.rbenv/versions/2.5.1/bin/beaker
+ [rbenv-which:46] OLDIFS='
'
+ [rbenv-which:47] IFS='
'
+ [rbenv-which:47] scripts=(`rbenv-hooks which`)
++ [rbenv-which:47] rbenv-hooks which
+ [rbenv-hooks:9] '[' which = --complete ']'
+ [rbenv-hooks:18] RBENV_COMMAND=which
+ [rbenv-hooks:19] '[' -z which ']'
+ [rbenv-hooks:24] enable -f /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv-realpath.dylib realpath
+ [rbenv-hooks:55] IFS=:
+ [rbenv-hooks:55] hook_paths=($RBENV_HOOK_PATH)
+ [rbenv-hooks:57] shopt -s nullglob
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:59] for script in '"$path/$RBENV_COMMAND"/*.bash'
+ [rbenv-hooks:60] realpath /usr/local/etc/rbenv.d/which/bundler.bash
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:58] for path in '"${hook_paths[@]}"'
+ [rbenv-hooks:63] shopt -u nullglob
+ [rbenv-which:48] IFS='
'
+ [rbenv-which:49] for script in '"${scripts[@]}"'
+ [rbenv-which:50] source /usr/local/Cellar/rbenv-bundler/1.00_1/etc/rbenv.d/which/bundler.bash
++++ [bundler.bash:17] dirname -- /usr/local/Cellar/rbenv-bundler/1.00_1/etc/rbenv.d/which/bundler.bash
+++ [bundler.bash:17] dirname -- /usr/local/Cellar/rbenv-bundler/1.00_1/etc/rbenv.d/which
++ [bundler.bash:17] source -- /usr/local/Cellar/rbenv-bundler/1.00_1/etc/rbenv.d/bundler/includes.sh
+++++++ [includes.sh:174] dirname -- /usr/local/Cellar/rbenv-bundler/1.00_1/etc/rbenv.d/bundler/includes.sh
++++++ [includes.sh:174] dirname -- /usr/local/Cellar/rbenv-bundler/1.00_1/etc/rbenv.d/bundler
+++++ [includes.sh:174] dirname -- /usr/local/Cellar/rbenv-bundler/1.00_1/etc/rbenv.d
++++ [includes.sh:174] dirname -- /usr/local/Cellar/rbenv-bundler/1.00_1/etc
+++ [includes.sh:174] plugin_root_dir=/usr/local/Cellar/rbenv-bundler/1.00_1
++++ [includes.sh:177] md5 ~/.rbenv
++++ [includes.sh:154] case "$(uname)" in
+++++ [includes.sh:154] uname
++++ [includes.sh:162] echo ~/.rbenv
++++ [includes.sh:162] command -- md5
++++ [includes.sh:162] md5
++++ [includes.sh:163] return -- 0
+++ [includes.sh:177] [[ -f /usr/local/Cellar/rbenv-bundler/1.00_1/share/rbenv/bundler/enabled_8efa5ef3edc9a4e7b57958cb331e9e4b ]]
+++ [includes.sh:178] plugin_enabled=1
++ [bundler.bash:19] [[ -z 1 ]]
++ [bundler.bash:23] manifest_dir=/usr/local/Cellar/rbenv-bundler/1.00_1/share/rbenv/bundler
+++ [bundler.bash:25] find_bundled_executable /usr/local/Cellar/rbenv-bundler/1.00_1/share/rbenv/bundler
+++ [includes.sh:20] local -- manifest_dir=/usr/local/Cellar/rbenv-bundler/1.00_1/share/rbenv/bundler
+++ [includes.sh:21] local -- manifest_entries
+++ [includes.sh:23] [[ -f /usr/local/Cellar/rbenv-bundler/1.00_1/share/rbenv/bundler/manifest.txt ]]
++++ [includes.sh:24] cat -- /usr/local/Cellar/rbenv-bundler/1.00_1/share/rbenv/bundler/manifest.txt
+++ [includes.sh:24] manifest_entries='~/Projects/beaker/Gemfile
4dba0f4d83ed236d429a0fbacc045fb5.txt'
+++ [includes.sh:29] ifs_save='
'
+++ [includes.sh:31] IFS='
'
+++ [includes.sh:32] manifest_entries=($manifest_entries)
+++ [includes.sh:33] IFS='
'
+++ [includes.sh:35] local -- project_dir
+++ [includes.sh:36] local -- gemspec_entries
+++ [includes.sh:64] (( i = 0 ))
+++ [includes.sh:64] (( i < 2 ))
++++ [includes.sh:39] dirname -- ~/Projects/beaker/Gemfile
+++ [includes.sh:39] project_dir=~/Projects/beaker
+++ [includes.sh:41] [[ ~/Projects/beaker != \/ ]]
+++ [includes.sh:42] project_dir=~/Projects/beaker/
+++ [includes.sh:45] current_dir=~/Projects/beaker
+++ [includes.sh:47] [[ ~/Projects/beaker != \/ ]]
+++ [includes.sh:48] current_dir=~/Projects/beaker/
+++ [includes.sh:52] [[ ~/Projects/beaker/ == '' ]]
++++ [includes.sh:56] cat -- /usr/local/Cellar/rbenv-bundler/1.00_1/share/rbenv/bundler/4dba0f4d83ed236d429a0fbacc045fb5.txt
+++ [includes.sh:56] gemspec_entries='rake
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/rake-10.5.0/bin
nokogiri
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.8.2/bin
aws-rb
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/aws-sdk-v1-1.67.0/bin
beaker-aws
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-aws-0.4.0/bin
beaker-docker
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-docker-0.3.3/bin
httpclient
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/httpclient-2.8.3/bin
generate-api
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/google-api-client-0.23.0/bin
beaker-google
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-google-0.1.0/bin
beaker-hiera
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-hiera-0.1.1/bin
beaker-hostgenerator
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-hostgenerator-1.1.13/bin
genconfig2
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-hostgenerator-1.1.13/bin
beaker-openstack
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-openstack-0.2.0/bin
ruby-ll
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/ruby-ll-2.1.2/bin
beaker-puppet
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-puppet-0.15.2/bin
beaker-vagrant
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-vagrant-0.5.0/bin
beaker-vmpooler
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-vmpooler-1.2.0/bin
fission
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/fission-0.5.0/bin
rbvmomish
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/rbvmomi-1.12.0/exe
beaker-vmware
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/beaker-vmware-0.2.0/bin
beaker
~/Projects/beaker-vcloud/bin
hocon
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/hocon-1.2.5/bin
byebug
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/byebug-9.0.6/bin
coderay
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/coderay-1.1.2/bin
pry
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/pry-0.11.3/bin
thor
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/thor-0.20.0/bin
beaker
~/Projects/beaker/bin
bundler
~/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.2/exe
htmldiff
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/bin
ldiff
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/diff-lcs-1.3/bin
rspec
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/rspec-core-3.7.1/exe
yard
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/yard-0.9.14/bin
yardoc
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/yard-0.9.14/bin
yri
~/Projects/beaker/vendor/bundle/ruby/2.5.0/gems/yard-0.9.14/bin'
+++ [includes.sh:58] ifs_save='
'
+++ [includes.sh:60] IFS='
'
+++ [includes.sh:61] gemspec_entries=($gemspec_entries)
+++ [includes.sh:62] IFS='
'
+++ [includes.sh:64] (( j = 0 ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ rake != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ nokogiri != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ aws-rb != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-aws != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-docker != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ httpclient != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ generate-api != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-google != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-hiera != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-hostgenerator != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ genconfig2 != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-openstack != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ ruby-ll != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-puppet != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-vagrant != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-vmpooler != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ fission != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ rbvmomish != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker-vmware != \b\e\a\k\e\r ]]
+++ [includes.sh:66] continue
+++ [includes.sh:64] (( j += 2  ))
+++ [includes.sh:64] (( j < 66 ))
+++ [includes.sh:65] [[ beaker != \b\e\a\k\e\r ]]
+++ [includes.sh:69] echo ~/Projects/beaker-vcloud/bin/beaker
+++ [includes.sh:71] return -- 0
++ [bundler.bash:25] bundled_executable=~/Projects/beaker-vcloud/bin/beaker
++ [bundler.bash:30] RBENV_COMMAND_PATH=~/Projects/beaker-vcloud/bin/beaker
+ [rbenv-which:53] '[' -x ~/Projects/beaker-vcloud/bin/beaker ']'
+ [rbenv-which:55] '[' 2.5.1 '!=' system ']'
+ [rbenv-which:55] '[' '!' -d ~/.rbenv/versions/2.5.1 ']'
+ [rbenv-which:59] echo 'rbenv: beaker: command not found'
rbenv: beaker: command not found
++ [rbenv-which:61] rbenv-whence beaker
+ [rbenv-whence:9] '[' beaker = --complete ']'
+ [rbenv-whence:14] '[' beaker = --path ']'
+ [rbenv-whence:18] print_paths=
+ [rbenv-whence:31] RBENV_COMMAND=beaker
+ [rbenv-whence:32] '[' -z beaker ']'
++ [rbenv-whence:37] whence beaker
++ [rbenv-whence:22] local command=beaker
++ [rbenv-whence:23] rbenv-versions --bare
++ [rbenv-whence:23] read version
+ [rbenv-versions:10] unset bare
+ [rbenv-versions:11] unset skip_aliases
+ [rbenv-versions:13] for arg in '"$@"'
+ [rbenv-versions:14] case "$arg" in
+ [rbenv-versions:19] bare=1
+ [rbenv-versions:28] versions_dir=~/.rbenv/versions
+ [rbenv-versions:30] enable -f /usr/local/Cellar/rbenv/1.1.1/libexec/rbenv-realpath.dylib realpath
+ [rbenv-versions:62] '[' -d ~/.rbenv/versions ']'
++ [rbenv-versions:63] realpath ~/.rbenv/versions
+ [rbenv-versions:63] versions_dir=~/.rbenv/versions
+ [rbenv-versions:66] '[' -n 1 ']'
+ [rbenv-versions:67] hit_prefix=
+ [rbenv-versions:68] miss_prefix=
+ [rbenv-versions:69] current_version=
+ [rbenv-versions:70] include_system=
+ [rbenv-versions:78] num_versions=0
+ [rbenv-versions:90] '[' -n '' ']'
+ [rbenv-versions:94] shopt -s nullglob
+ [rbenv-versions:95] for path in '"$versions_dir"/*'
+ [rbenv-versions:96] '[' -d ~/.rbenv/versions/2.2.5 ']'
+ [rbenv-versions:97] '[' -n '' ']'
+ [rbenv-versions:101] print_version 2.2.5
+ [rbenv-versions:81] '[' 2.2.5 == '' ']'
+ [rbenv-versions:84] echo 2.2.5
+ [rbenv-versions:86] num_versions=1
+ [rbenv-versions:95] for path in '"$versions_dir"/*'
+ [rbenv-versions:96] '[' -d ~/.rbenv/versions/2.4.4 ']'
+ [rbenv-versions:97] '[' -n '' ']'
+ [rbenv-versions:101] print_version 2.4.4
+ [rbenv-versions:81] '[' 2.4.4 == '' ']'
+ [rbenv-versions:84] echo 2.4.4
+ [rbenv-versions:86] num_versions=2
+ [rbenv-versions:95] for path in '"$versions_dir"/*'
+ [rbenv-versions:96] '[' -d ~/.rbenv/versions/2.5.1 ']'
+ [rbenv-versions:97] '[' -n '' ']'
+ [rbenv-versions:101] print_version 2.5.1
+ [rbenv-versions:81] '[' 2.5.1 == '' ']'
+ [rbenv-versions:84] echo 2.5.1
+ [rbenv-versions:86] num_versions=3
+ [rbenv-versions:104] shopt -u nullglob
+ [rbenv-versions:106] '[' 3 -eq 0 ']'
+++ [rbenv-whence:24] rbenv-prefix 2.2.5
+ [rbenv-prefix:13] '[' 2.2.5 = --complete ']'
+ [rbenv-prefix:18] '[' -n 2.2.5 ']'
+ [rbenv-prefix:19] export RBENV_VERSION=2.2.5
+ [rbenv-prefix:19] RBENV_VERSION=2.2.5
+ [rbenv-prefix:24] '[' 2.2.5 = system ']'
+ [rbenv-prefix:36] RBENV_PREFIX_PATH=~/.rbenv/versions/2.2.5
+ [rbenv-prefix:37] '[' '!' -d ~/.rbenv/versions/2.2.5 ']'
+ [rbenv-prefix:42] echo ~/.rbenv/versions/2.2.5
++ [rbenv-whence:24] path=~/.rbenv/versions/2.2.5/bin/beaker
++ [rbenv-whence:25] '[' -x ~/.rbenv/versions/2.2.5/bin/beaker ']'
++ [rbenv-whence:23] read version
+++ [rbenv-whence:24] rbenv-prefix 2.4.4
+ [rbenv-prefix:13] '[' 2.4.4 = --complete ']'
+ [rbenv-prefix:18] '[' -n 2.4.4 ']'
+ [rbenv-prefix:19] export RBENV_VERSION=2.4.4
+ [rbenv-prefix:19] RBENV_VERSION=2.4.4
+ [rbenv-prefix:24] '[' 2.4.4 = system ']'
+ [rbenv-prefix:36] RBENV_PREFIX_PATH=~/.rbenv/versions/2.4.4
+ [rbenv-prefix:37] '[' '!' -d ~/.rbenv/versions/2.4.4 ']'
+ [rbenv-prefix:42] echo ~/.rbenv/versions/2.4.4
++ [rbenv-whence:24] path=~/.rbenv/versions/2.4.4/bin/beaker
++ [rbenv-whence:25] '[' -x ~/.rbenv/versions/2.4.4/bin/beaker ']'
++ [rbenv-whence:23] read version
+++ [rbenv-whence:24] rbenv-prefix 2.5.1
+ [rbenv-prefix:13] '[' 2.5.1 = --complete ']'
+ [rbenv-prefix:18] '[' -n 2.5.1 ']'
+ [rbenv-prefix:19] export RBENV_VERSION=2.5.1
+ [rbenv-prefix:19] RBENV_VERSION=2.5.1
+ [rbenv-prefix:24] '[' 2.5.1 = system ']'
+ [rbenv-prefix:36] RBENV_PREFIX_PATH=~/.rbenv/versions/2.5.1
+ [rbenv-prefix:37] '[' '!' -d ~/.rbenv/versions/2.5.1 ']'
+ [rbenv-prefix:42] echo ~/.rbenv/versions/2.5.1
++ [rbenv-whence:24] path=~/.rbenv/versions/2.5.1/bin/beaker
++ [rbenv-whence:25] '[' -x ~/.rbenv/versions/2.5.1/bin/beaker ']'
++ [rbenv-whence:23] read version
+ [rbenv-whence:37] result=
+ [rbenv-whence:38] '[' -n '' ']'
++ [rbenv-which:61] true
+ [rbenv-which:61] versions=
+ [rbenv-which:62] '[' -n '' ']'
+ [rbenv-which:70] exit 127
+ [rbenv-exec:33] RBENV_COMMAND_PATH=

Plugin not finding bundles

I'm having an issue that seems to run outside of those previously listed here.

I'm unable to get the plugin working at all (I've tried multiple configurations now).

Right now I'm running a fresh copy of rbenv, with rbenv-bundler and ruby-build as the only plugins. Ruby 1.9.3-p125 is installed with the bundler 1.1rc7 plugin installed and no others (outside of the default gems). On MacOS 10.7.3 if that matters at all.

If I bundle init, and add jekyll (or any other gems), then bundler --path vendor/local, then rbenv rehash. I don't get any of the gems added.

Any ideas? :)

Slow Shell Start Up

Hey @carsomyr, thanks for ironing out the rbenv 0.4.0 issues. Part of the debug process you had me put in some puts statements in rehash.rb. It actually brings up that rehash is being called 4 times whenever I start a new terminal session. So I put puts "rehashing #{out_dir}" in self.rehash and I see the following lines every time:

rehashing /usr/local/Cellar/rbenv-bundler/0.95/share/rbenv/bundler
rehashing /usr/local/Cellar/rbenv-bundler/0.95/share/rbenv/bundler
rehashing /usr/local/Cellar/rbenv-bundler/0.95/share/rbenv/bundler
rehashing /usr/local/Cellar/rbenv-bundler/0.95/share/rbenv/bundler

rbenv rehash #=> ruby: no such file to load -- rubygems (LoadError)

$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec $SHELL -l
$ mkdir -p ~/.rbenv/plugins
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ git clone https://github.com/sstephenson/rbenv-vars.git ~/.rbenv/plugins/rbenv-vars
$ git clone https://github.com/carsomyr/rbenv-bundler.git ~/.rbenv/plugins/rbenv-bundler

$ rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
Installed ruby-2.0.0-p0 to /home/game/.rbenv/versions/2.0.0-p0

/home/xxxxx/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:21:in `require': no such file to load -- rubygems (LoadError)
    from /home/xxxxx/.rbenv/plugins/rbenv-bundler/etc/rbenv.d/bundler/rehash.rb:21

$ rbenv global 2.0.0-p0
$ rbenv rehash
ruby: no such file to load -- rubygems (LoadError)
Could not load the bundler gem for Ruby version 2.0.0-p0.

$ gem install bundler
$ rbenv rehash
ruby: no such file to load -- rubygems (LoadError)

FYI:

$ uname -a
Linux xxxxx 2.6.18-308.el5PAE #1 SMP Tue Feb 21 20:46:05 EST 2012 i686 i686 i386 GNU/Linux

is it possible to work with global installed gems?

Hi Carsomyr,

Is it possible to make the plugin work for 'non-vendorized' gems (not installed with bundle install --path )?

It would avoid the duplication of gem files and save some disk space.

Nice plugin! Thanks

Unfortunately not working with rbenv 0.4.0 (command not found)

$ rbenv version
2.0.0-p247 (set by /Users/blablabla/.ruby-version)
$ rbenv rehash
$ rbenv bundler on
$ unicorn
bundler: command not found: unicorn
Install missing gem executables with `bundle install`
$ rbenv bundler off
$ unicorn
I, [2014-03-20T19:31:20.948909 #24817]  INFO -- : listening on addr=0.0.0.0:8080 fd=9
I, [2014-03-20T19:31:20.949021 #24817]  INFO -- : worker=0 spawning...
I, [2014-03-20T19:31:20.949938 #24817]  INFO -- : master process ready
I, [2014-03-20T19:31:20.951025 #24881]  INFO -- : worker=0 spawned pid=24881
I, [2014-03-20T19:31:20.951494 #24881]  INFO -- : Refreshing Gem list
/Users/tehkode/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/bundler-1.5.2/lib/bundler/runtime.rb:34:in `block in setup': You have already activated raindrops 0.11.0, but your Gemfile requires raindrops 0.10.0. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
$ bundle exec unicorn
I, [2014-03-20T19:37:29.837977 #26224]  INFO -- : listening on addr=0.0.0.0:8080 fd=9
I, [2014-03-20T19:37:29.838097 #26224]  INFO -- : worker=0 spawning...
I, [2014-03-20T19:37:29.839355 #26224]  INFO -- : master process ready
I, [2014-03-20T19:37:29.840628 #26291]  INFO -- : worker=0 spawned pid=26291
I, [2014-03-20T19:37:29.841167 #26291]  INFO -- : Refreshing Gem list
I, [2014-03-20T19:38:06.322937 #26291]  INFO -- : worker=0 ready

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.