Rubygems: Regression of bundler#7536 - bundler/inline breaks

Created on 15 Jun 2020  路  2Comments  路  Source: rubygems/rubygems

I'm experiencing what seems to be a regression of https://github.com/rubygems/bundler/issues/7536

  1. Do you have a reproduction script?
# inline.rb
require "bundler/inline"
gemfile do
  source "https://rubygems.org"
  gem "capistrano", require: false
end

require "capistrano/all"

Just drop this into a location without a Gemfile and run it.

  1. What are you trying to accomplish?

I'm attempting to use bundler/inline without a Gemfile. This was previously broken in Bundler 2.1.0, fixed in 2.1.4, and seems to have regressed somehow over this weekend. Both myself and a coworker have reproduced the error in separate environments.

  1. What command did you run?

    ruby inline.rb

  2. What were you expecting to happen?

    Capistrano should be loaded.

  3. What actually happened?

    Bundler throws an exception:

Traceback (most recent call last):
        27: from cap.rb:9:in `<main>'
        26: from cap.rb:9:in `require'
        25: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/capistrano-3.11.2/lib/capistrano/all.rb:2:in `<top (required)>'
        24: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/capistrano-3.11.2/lib/capistrano/all.rb:2:in `require'
        23: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit.rb:29:in `<top (required)>'
        22: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit.rb:29:in `require_relative'
        21: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit/all.rb:37:in `<top (required)>'
        20: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit/all.rb:37:in `require_relative'
        19: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/netssh.rb:4:in `<top (required)>'
        18: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/netssh.rb:4:in `require'
        17: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:11:in `<top (required)>'
        16: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:11:in `require'
        15: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/session.rb:6:in `<top (required)>'
        14: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/session.rb:6:in `require'
        13: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/algorithms.rb:1:in `<top (required)>'
        12: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/algorithms.rb:1:in `require'
        11: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/buffer.rb:5:in `<top (required)>'
        10: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/buffer.rb:5:in `require'
         9: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/authentication/ed25519_loader.rb:1:in `<top (required)>'
         8: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/authentication/ed25519_loader.rb:2:in `<module:Net>'
         7: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/authentication/ed25519_loader.rb:3:in `<module:SSH>'
         6: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/authentication/ed25519_loader.rb:7:in `<module:Authentication>'
         5: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/authentication/ed25519_loader.rb:10:in `<module:ED25519Loader>'
         4: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/authentication/ed25519_loader.rb:10:in `require'
         3: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/authentication/ed25519.rb:1:in `<top (required)>'
         2: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/rubygems_integration.rb:333:in `block (2 levels) in replace_gem'
         1: from /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-2.1.4/lib/bundler.rb:434:in `default_gemfile'
/home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/bundler-2.1.4/lib/bundler/shared_helpers.rb:21:in `default_gemfile': Could not locate Gemfile (Bundler::GemfileNotFound)
  1. Please run bundle env and paste the output below:

Environment

Bundler       2.1.4
  Platforms   ruby, x86_64-linux
Ruby          2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]
  Full Path   /home/chris/.rbenv/versions/2.5.5/bin/ruby
  Config Dir  /home/chris/.rbenv/versions/2.5.5/etc
RubyGems      2.7.6.2
  Gem Home    /home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0
  Gem Path    /home/chris/.gem/ruby/2.5.0:/home/chris/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0
  User Home   /home/chris
  User Path   /home/chris/.gem/ruby/2.5.0
  Bin Dir     /home/chris/.rbenv/versions/2.5.5/bin
Tools
  Git         2.25.1
  RVM         not installed
  rbenv       rbenv 1.1.2-30-gc879cb0
  chruby      not installed

Bundler Build Metadata

Built At          2020-01-05
Git SHA           32a4159325
Released Version  true

Bundler settings

build.fb
  Set for the current user (/home/chris/.bundle/config): "--with-firebird-dir=/opt/firebird"
gem.test
  Set for the current user (/home/chris/.bundle/config): "minitest"
gem.mit
  Set for the current user (/home/chris/.bundle/config): false
gem.coc
  Set for the current user (/home/chris/.bundle/config): false
Bundler bug report

All 2 comments

Hi!

This seems not a regression, but a separate bug. Something must've changed in capistrano (in net-ssh actually), and now a gem is failing to be activated. When handling that error, bundler is assuming that there's a Gemfile and crashing here:

https://github.com/rubygems/rubygems/blob/ea2376928988c8124bba661e0754d7a00dcab347/bundler/lib/bundler/rubygems_integration.rb#L323

I will try to fix this.

That makes sense; the bundler version hasn't changed! Please let me know if I can provide further help or context!

Was this page helpful?
0 / 5 - 0 ratings