guard-bundler: Problems using with bundler > 1.12

I got an error using guard-bundler with version > 1.12, sorry I can’t describe the problem, so I’m gonna paste some errors and be available for further investigation

gem install bundler -v 1.12.0

○ guard                        
/opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
        from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:278:in `activate_bin_path'
        from /opt/boxen/rbenv/versions/2.3.1/bin/bundle:22:in `<main>'
11:29:00 - INFO - Bundling...
/opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
        from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:278:in `activate_bin_path'
        from /opt/boxen/rbenv/versions/2.3.1/bin/bundle:22:in `<main>'
11:29:00 - INFO - Bundle can't be installed -- Please check manually

gem uninstall -x bundler gem install bundler -v 1.11.2

○ guard
11:29:47 - INFO - Bundle already up-to-date
11:29:47 - INFO - Guard is now watching at '/Users/fernandes/src/project'

ps: I don’t discard the possibility of being a bundler bug, I’m just in no position to judge.

thank you!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

on another project the workaround didn’t work, so I did

Open3.popen3("gem contents bundler") do |i, o|
  Kernel.system("gem install bundler") if o.read.empty?
end

would be great to check if installed version of bundler is the same running guard, but atm this solution is ok hehehe

hey @e2 thanks for quick reply… 😃

trying bundle exec guard

○ gem install bundler
Fetching: bundler-1.12.3.gem (100%)
Successfully installed bundler-1.12.3
1 gem installed
○ bundle exec guard
/opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
        from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:278:in `activate_bin_path'
        from /opt/boxen/rbenv/versions/2.3.1/bin/bundle:22:in `<main>'
15:38:45 - INFO - Bundling...
/opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
        from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:278:in `activate_bin_path'
        from /opt/boxen/rbenv/versions/2.3.1/bin/bundle:22:in `<main>'
15:38:45 - INFO - Bundle can't be installed -- Please check manually

Same problem 😕

my gem env on Guardfile output (running with guard and bundle exec guard) the output is the same

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.4
  - RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x86_64-darwin15]
  - INSTALLATION DIRECTORY: /Users/fernandes/src/project/vendor/bundle/ruby/2.3.0
  - USER INSTALLATION DIRECTORY: /Users/fernandes/.gem/ruby/2.3.0
  - RUBY EXECUTABLE: /opt/boxen/rbenv/versions/2.3.1/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/fernandes/src/project/vendor/bundle/ruby/2.3.0/bin
  - SPEC CACHE DIRECTORY: /Users/fernandes/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /opt/boxen/rbenv/versions/2.3.1/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-15
  - GEM PATHS:
     - /Users/fernandes/src/project/vendor/bundle/ruby/2.3.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/fernandes/src/project/vendor/bundle/ruby/2.3.0/bin
     - /opt/boxen/rbenv/versions/2.3.1/bin
     - /opt/boxen/rbenv/libexec
     - /opt/boxen/phpenv/shims
     - /opt/boxen/phpenv/bin
     - /opt/boxen/phpenv/plugins/php-build/bin
     - bin
     - /opt/boxen/rbenv/shims
     - /opt/boxen/rbenv/bin
     - /opt/boxen/ruby-build/bin
     - /opt/boxen/phantomenv/shims
     - /opt/boxen/phantomenv/bin
     - node_modules/.bin
     - /opt/boxen/nodenv/shims
     - /opt/boxen/nodenv/bin
     - /opt/boxen/homebrew/bin
     - /opt/boxen/homebrew/sbin
     - /opt/boxen/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/bin
     - /opt/X11/bin
     - /usr/local/heroku/bin
     - /Users/fernandes/.bin
/opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:250:in `find_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException)
        from /opt/boxen/rbenv/versions/2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:278:in `activate_bin_path'
        from /opt/boxen/rbenv/versions/2.3.1/bin/bundle:22:in `<main>'

about RUBYGEMS_GEMDEPS (not set)

○ echo $RUBYGEMS_GEMDEPS

and last bundle exec guard -d output

put on this gist for readability

About my env, it’s a rails application with some gems… Sadly it’s an internal project, but I did the following

  • rails new guardbundler
  • Added guard-bundler gem
  • guard init
  • guard

And got the same problem, update the project on https://github.com/fernandes/guardbundler (it’s just a vanilla rails app, but we can work on the same repo to figure out what is causing the bug), added you as collab.