Bundle Install fails with Ruby 2.6.1 Bundler version 1.15.2 when fetching gems for repository

I am encountering errors when running bundle install with bundler version 1.15.2 (to match Heroku version). This issue pops up when installing gems from a repository (like on GitHub).

  • image: circleci/ruby:2.6.1-node-browsers
    environment:
    HEROKU_BUNDLER_VERSION: 1.15.2

bundle install (with 1.15.2)
NoMethodError: undefined method `’ for nil:NilClass

I have opened a GH issue with Bundler at https://github.com/bundler/bundler/issues/7021 which contains more details, but they aren’t able to help as this is a pretty old version of bundler (we need to use this version to match production environment in Heroku). I encounter this issue locally but Heroku seems to build the app with bundler 1.15.2 just fine.

If you SSH in, https://circleci.com/docs/2.0/ssh-access-jobs/, are you able to get more information? It seems like Bundler may be trying to to call something not in that version of Ruby, so I wonder if one or more of them are not at the version you are expecting.

@drazisil thanks for the response

I’ll copy the stack trace from the GH issue I linked, which occurred for me locally but this is the same error that I encountered yesterday when I SSH’d into my job container. Happy to provide any other environment information you need.

I’d like to note that Heroku is able to build my project with Bundler 1.15.2. I’ve been chatting with them to try to gather additional information on how their build environment succeeds while others seem to fail. So far I have encountered this error locally with rbenv, the circleci/ruby:2.6.1-node-browsers docker container, as well as the standard ruby:2.6.1 docker container.

NoMethodError: undefined method `[]' for nil:NilClass
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/site_ruby/2.6.0/rubygems/installer.rb:484:in `generate_bin'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/source/path/installer.rb:46:in `generate_bin'
/Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/source/path/installer.rb:35:in `block in
post_install'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/shared_helpers.rb:55:in `chdir'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/shared_helpers.rb:55:in `block in chdir'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/shared_helpers.rb:54:in `chdir'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/source/path/installer.rb:27:in `post_install'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/source/path.rb:233:in `generate_bin'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/source/git.rb:184:in `install'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/installer/gem_installer.rb:55:in `install'
/Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/installer/gem_installer.rb:15:in
`install_from_spec'
/Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/installer/parallel_installer.rb:115:in `block in
worker_pool'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/worker.rb:63:in `apply_func'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/worker.rb:58:in `block in process_queue'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/worker.rb:55:in `loop'
  /Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/worker.rb:55:in `process_queue'
/Users/philcoggins/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.15.2/lib/bundler/worker.rb:89:in `block (2 levels) in
create_threads'

If it occurs on that image, then it’s very likely to not be anything we can help with. I’d be very interested to see what Heroku comes back with. Do you have a ruby-version file or such that might be changing the version on Heroku?

Please keep us updated with what they come back with :slight_smile:

I spoke with Heroku and I had totally overlooked the fact that they had bundler v2 available for Ruby 2.6.1, so I updated my build to use that instead and everything is building fine now.

I think there’s still a possibility that people will encounter this when utilizing 2.6.1 and bundler 1.15.2 and bundling gems for repositories, but hopefully most people are moving away from 1.15.2 at this point since it’s old and doesn’t seem stable with Ruby 2.6.1 at all.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.