rvm/rubygems-bundler

Rubygems-bundler should never bundle exec when using the ey/engineyard gem

Closed this issue · 5 comments

The engineyard-gem is not meant to be run inside a bundled environment. However rubygems-bundler doesn't seem to know that and breaks the gem when trying to run it. It would make sense for rubygems-bundler to check if a gem is in the current Gemfile before attempting to run with bundle exec.

rubygems-bundler loads bundler only for gems listed in Gemfile / Gemfile.lock, if this is not what you want you can specify excludes/includes using .noexec.yaml:

exclude:
   - ey

I checked and engineyard was not in Gemfile or Gemfile.lock when I ran the command. Any idea how this could have happened?

Are you sure that rubygems-bundler loaded Bundler.setup? There are few other tools that also do that:

  • oh-my-zsh has a plugin
  • rvm has a hook
  • rbenv has a plugin
  • noexec gem does it
  • running bundle exec bash does it
  • setting shell options like RUBYOPT can lead to it too

I saw rubygems-bundler in the stacktrace so I assumed that it is involved. I just found the stack trace from earlier:

[0] ➜ rvm use 1.9.3           
Using /Users/mutle/.rvm/gems/ruby-1.9.3-p194
[0] ➜ ey d
/Users/mutle/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find activesupport-3.1.3 in any of the sources (Bundler::GemNotFound)
    from /Users/mutle/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `map!'
    from /Users/mutle/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `materialize'
    from /Users/mutle/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
    from /Users/mutle/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/environment.rb:27:in `specs'
    from /Users/mutle/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
    from /Users/mutle/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
    from /Users/mutle/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
    from /Users/mutle/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /Users/mutle/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /Users/mutle/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/mutle/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:9:in `<main>'

After I ran the rubygems-bundler-uninstall command it started working again.

Could you test with 1.0.7:

gem install rubygems-bundler
gem regenerate_binstubs