Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

NoMethodError: undefined method `version' for nil:NilClass #6156

Closed
christiannelson opened this issue Nov 7, 2017 · 1 comment · Fixed by #6157
Closed

NoMethodError: undefined method `version' for nil:NilClass #6156

christiannelson opened this issue Nov 7, 2017 · 1 comment · Fixed by #6157

Comments

@christiannelson
Copy link

Error Report

Questions

Please fill out answers to these questions, it'll help us figure out
why things are going wrong.

  • What did you do?

    I ran the command bundle update --group=development. The same error happens when running bundle update --group=test as well.

  • What did you expect to happen?

    I expected Bundler to update all of the deps in the development group.

  • What happened instead?

    Instead, some deps updated, but then an exception was thrown.

  • Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?

    I looked and did not find a very similar issue.

Backtrace

NoMethodError: undefined method `version' for nil:NilClass
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/cli/update.rb:71:in `block in run'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/cli/update.rb:70:in `each'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/cli/update.rb:70:in `run'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/cli.rb:266:in `update'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/cli.rb:27:in `dispatch'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/cli.rb:18:in `start'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle:30:in `block in <top (required)>'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/friendly_errors.rb:122:in `with_friendly_errors'
  /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/exe/bundle:22:in `<top (required)>'
  ./bin/bundle:5:in `load'
  ./bin/bundle:5:in `<main>'

Environment

Bundler       1.16.0
  Platforms   ruby, x86_64-darwin-16
Ruby          2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
  Full Path   /Users/christian/.rbenv/versions/2.4.2/bin/ruby
  Config Dir  /Users/christian/.rbenv/versions/2.4.2/etc
RubyGems      2.6.13
  Gem Home    /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0
  Gem Path    /Users/christian/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0:/Users/christian/.gem/ruby/2.4.0
  User Path   /Users/christian/.gem/ruby/2.4.0
  Bin Dir     /Users/christian/.rbenv/versions/2.4.2/bin
OpenSSL
  Compiled    OpenSSL 1.0.2l  25 May 2017
  Loaded      OpenSSL 1.0.2m  2 Nov 2017
  Cert File   /usr/local/etc/openssl/cert.pem
  Cert Dir    /usr/local/etc/openssl/certs
Tools
  Git         2.15.0
  RVM         not installed
  rbenv       rbenv 1.1.1

  chruby      not installed

Bundler Build Metadata

Built At          2017-10-31
Git SHA           10f20fa33
Released Version  true

Bundler settings

jobs
  Set for the current user (/Users/christian/.bundle/config): "4"
build.rgeo
  Set for the current user (/Users/christian/.bundle/config): "--with-geos-dir=/usr/local/Cellar/geos/3.4.2"
ignore_messages
  Set for the current user (/Users/christian/.bundle/config): true
build.eventmachine
  Set for the current user (/Users/christian/.bundle/config): "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
build.puma
  Set for the current user (/Users/christian/.bundle/config): "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
build.mailcatcher
  Set for the current user (/Users/christian/.bundle/config): "--with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include"
gem.coc
  Set for the current user (/Users/christian/.bundle/config): false
gem.mit
  Set for the current user (/Users/christian/.bundle/config): false
gem.test
  Set for the current user (/Users/christian/.bundle/config): "rspec"
git.allow_insecure
  Set for the current user (/Users/christian/.bundle/config): "true"
only_update_to_newer_versions
  Set for the current user (/Users/christian/.bundle/config): true
gemfile
  Set via BUNDLE_GEMFILE: "/Users/christian/Projects/carbon-five/timesheet/Gemfile"

Gemfile

Gemfile

# frozen_string_literal: true

source 'http://rubygems.org'

ruby '2.4.2'

# Core Framework
gem 'puma'
gem 'rails', '~> 4.2.10'
gem 'rack-canonical-host'
gem 'pg'
gem 'girl_friday'

# Auth
gem 'devise'
gem 'omniauth'
gem 'omniauth-github'
gem 'omniauth-google-oauth2'
gem 'omniauth-instagram'
gem 'signet', github: 'google/signet', ref: '7ae73a5e2bdaf80eb6027972190bd60a4ef289c8' # Ruby 2.4.0 warnings

# Back-end-y
gem 'axlsx', github: 'randym/axlsx'
gem 'awesome_print'
gem 'business_time'
gem 'json'
gem 'nokogiri'
gem 'nori'
gem 'oj'
# gem 'quiet_assets' # rails 5.0

# Front-end-y
gem 'coffee-rails'
gem 'dynamic_form'
gem 'eco'
gem 'haml'
gem 'jbuilder'
gem 'jquery-rails', '~> 2.0.0' # Cukes fail: jquery updates, jquery-ui removed, etc.
gem 'sass-rails'
gem 'uglifier'

# Integrations
gem 'aws-sdk', '~> 2'
gem 'google-api-client'
gem 'newrelic_rpm'
gem 'postmark-rails'
gem 'rollbar'
gem 'typhoeus'

group :production, :acceptance do
  # gem 'heroku_rails_deflate' # rails 5.0
  gem 'rack-timeout'
  # gem 'rails_stdout_logging' # rails 5.0
end

group :development do
  gem 'bullet'
  # gem 'binding_of_caller' # rails 5.0
  # gem 'better_errors' # rails 5.0
end

group :test do
  gem 'chronic'
  gem 'shoulda-matchers'
  gem 'database_cleaner'
  gem 'launchy'
  gem 'factory_girl_rails'
  gem 'webmock'
  gem 'capybara'
  gem 'poltergeist'
  gem 'faker'
end

group :development, :test do
  gem 'spring'
  gem 'spring-commands-rspec'
  gem 'spring-commands-cucumber'
  gem 'cucumber-rails', require: false
  gem 'rspec-rails'
  gem 'rspec-collection_matchers'
  gem 'rubocop', '~> 0.47.1', require: false # Updating triggers a sh*tstorm of new violations.
  gem 'jasmine', '~> 1.3' # TypeError: 'undefined' is not an object (evaluating 'jasmine.Matchers.prototype')
  gem 'jasmine-rails'
  gem 'pry-rails'
  gem 'pry-byebug'
  gem 'dotenv-rails'
end

Gemfile.lock

GIT
  remote: git://github.com/google/signet.git
  revision: 7ae73a5e2bdaf80eb6027972190bd60a4ef289c8
  ref: 7ae73a5e2bdaf80eb6027972190bd60a4ef289c8
  specs:
    signet (0.7.3)
      addressable (~> 2.3)
      faraday (~> 0.9)
      jwt (~> 1.5)
      multi_json (~> 1.10)

GIT
  remote: git://github.com/randym/axlsx.git
  revision: c8ac844572b25fda358cc01d2104720c4c42f450
  specs:
    axlsx (2.1.0.pre)
      htmlentities (~> 4.3.4)
      mimemagic (~> 0.3)
      nokogiri (>= 1.6.6)
      rubyzip (>= 1.2.1)

GEM
  remote: http://rubygems.org/
  specs:
    actionmailer (4.2.10)
      actionpack (= 4.2.10)
      actionview (= 4.2.10)
      activejob (= 4.2.10)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.10)
      actionview (= 4.2.10)
      activesupport (= 4.2.10)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (4.2.10)
      activesupport (= 4.2.10)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    activejob (4.2.10)
      activesupport (= 4.2.10)
      globalid (>= 0.3.0)
    activemodel (4.2.10)
      activesupport (= 4.2.10)
      builder (~> 3.1)
    activerecord (4.2.10)
      activemodel (= 4.2.10)
      activesupport (= 4.2.10)
      arel (~> 6.0)
    activesupport (4.2.10)
      i18n (~> 0.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    addressable (2.5.2)
      public_suffix (>= 2.0.2, < 4.0)
    arel (6.0.4)
    ast (2.3.0)
    awesome_print (1.7.0)
    aws-sdk (2.8.11)
      aws-sdk-resources (= 2.8.11)
    aws-sdk-core (2.8.11)
      aws-sigv4 (~> 1.0)
      jmespath (~> 1.0)
    aws-sdk-resources (2.8.11)
      aws-sdk-core (= 2.8.11)
    aws-sigv4 (1.0.0)
    backports (3.10.3)
    bcrypt (3.1.11)
    builder (3.2.3)
    bullet (5.6.1)
      activesupport (>= 3.0.0)
      uniform_notifier (~> 1.10.0)
    business_time (0.9.1)
      activesupport (>= 4.2.8)
      tzinfo
    byebug (9.1.0)
    capybara (2.15.4)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    childprocess (0.8.0)
      ffi (~> 1.0, >= 1.0.11)
    chronic (0.10.2)
    cliver (0.3.2)
    coderay (1.1.2)
    coffee-rails (4.2.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.2.x)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.12.2)
    concurrent-ruby (1.0.5)
    connection_pool (1.2.0)
    crack (0.4.3)
      safe_yaml (~> 1.0.0)
    crass (1.0.2)
    cucumber (3.0.1)
      builder (>= 2.1.2)
      cucumber-core (~> 3.0.0)
      cucumber-expressions (~> 4.0.3)
      cucumber-wire (~> 0.0.1)
      diff-lcs (~> 1.3)
      gherkin (~> 4.0)
      multi_json (>= 1.7.5, < 2.0)
      multi_test (>= 0.1.2)
    cucumber-core (3.0.0)
      backports (>= 3.8.0)
      cucumber-tag_expressions (>= 1.0.1)
      gherkin (>= 4.1.3)
    cucumber-expressions (4.0.4)
    cucumber-rails (1.5.0)
      capybara (>= 1.1.2, < 3)
      cucumber (>= 1.3.8, < 4)
      mime-types (>= 1.17, < 4)
      nokogiri (~> 1.5)
      railties (>= 4, < 5.2)
    cucumber-tag_expressions (1.0.1)
    cucumber-wire (0.0.1)
    database_cleaner (1.6.2)
    declarative (0.0.9)
    declarative-option (0.1.0)
    devise (4.2.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.1)
      responders
      warden (~> 1.2.3)
    diff-lcs (1.3)
    dotenv (2.2.1)
    dotenv-rails (2.2.1)
      dotenv (= 2.2.1)
      railties (>= 3.2, < 5.2)
    dynamic_form (1.1.4)
    eco (1.0.0)
      coffee-script
      eco-source
      execjs
    eco-source (1.1.0.rc.1)
    erubis (2.7.0)
    ethon (0.10.1)
      ffi (>= 1.3.0)
    execjs (2.7.0)
    factory_girl (4.8.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.8.0)
      factory_girl (~> 4.8.0)
      railties (>= 3.0.0)
    faker (1.7.3)
      i18n (~> 0.5)
    faraday (0.11.0)
      multipart-post (>= 1.2, < 3)
    ffi (1.9.18)
    gherkin (4.1.3)
    girl_friday (0.11.2)
      connection_pool (~> 1.0)
      rubinius-actor
    globalid (0.4.1)
      activesupport (>= 4.2.0)
    google-api-client (0.10.1)
      addressable (~> 2.3)
      googleauth (~> 0.5)
      httpclient (~> 2.7)
      hurley (~> 0.1)
      memoist (~> 0.11)
      mime-types (>= 1.6)
      representable (~> 3.0)
      retriable (>= 2.0, < 4.0)
    googleauth (0.5.1)
      faraday (~> 0.9)
      jwt (~> 1.4)
      logging (~> 2.0)
      memoist (~> 0.12)
      multi_json (~> 1.11)
      os (~> 0.9)
      signet (~> 0.7)
    haml (4.0.7)
      tilt
    hashdiff (0.3.7)
    hashie (3.5.5)
    htmlentities (4.3.4)
    httpclient (2.8.3)
    hurley (0.2)
    i18n (0.9.1)
      concurrent-ruby (~> 1.0)
    jasmine (1.3.2)
      jasmine-core (~> 1.3.1)
      rack (~> 1.0)
      rspec (>= 1.3.1)
      selenium-webdriver (>= 0.1.3)
    jasmine-core (1.3.1)
    jasmine-rails (0.14.7)
      jasmine-core (>= 1.3, < 3.0)
      phantomjs (>= 1.9)
      railties (>= 3.2.0)
      sprockets-rails
    jbuilder (2.6.3)
      activesupport (>= 3.0.0, < 5.2)
      multi_json (~> 1.2)
    jmespath (1.3.1)
    jquery-rails (2.0.3)
      railties (>= 3.1.0, < 5.0)
      thor (~> 0.14)
    json (2.1.0)
    jwt (1.5.6)
    launchy (2.4.3)
      addressable (~> 2.3)
    little-plugger (1.1.4)
    logging (2.2.0)
      little-plugger (~> 1.1)
      multi_json (~> 1.10)
    loofah (2.1.1)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.0)
      mini_mime (>= 0.1.1)
    memoist (0.15.0)
    method_source (0.9.0)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mimemagic (0.3.2)
    mini_mime (0.1.4)
    mini_portile2 (2.3.0)
    minitest (5.10.3)
    multi_json (1.12.2)
    multi_test (0.1.2)
    multi_xml (0.6.0)
    multipart-post (2.0.0)
    newrelic_rpm (4.0.0.332)
    nokogiri (1.8.1)
      mini_portile2 (~> 2.3.0)
    nori (2.6.0)
    oauth2 (1.3.1)
      faraday (>= 0.8, < 0.12)
      jwt (~> 1.0)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (>= 1.2, < 3)
    oj (2.18.5)
    omniauth (1.6.1)
      hashie (>= 3.4.6, < 3.6.0)
      rack (>= 1.6.2, < 3)
    omniauth-github (1.2.3)
      omniauth (~> 1.5)
      omniauth-oauth2 (>= 1.4.0, < 2.0)
    omniauth-google-oauth2 (0.4.1)
      jwt (~> 1.5.2)
      multi_json (~> 1.3)
      omniauth (>= 1.1.1)
      omniauth-oauth2 (>= 1.3.1)
    omniauth-instagram (1.0.2)
      omniauth (~> 1)
      omniauth-oauth2 (~> 1)
    omniauth-oauth2 (1.4.0)
      oauth2 (~> 1.0)
      omniauth (~> 1.2)
    orm_adapter (0.5.0)
    os (0.9.6)
    parser (2.4.0.0)
      ast (~> 2.2)
    pg (0.20.0)
    phantomjs (2.1.1.0)
    poltergeist (1.16.0)
      capybara (~> 2.1)
      cliver (~> 0.3.1)
      websocket-driver (>= 0.2.0)
    postmark (1.10.0)
      json
      rake
    postmark-rails (0.15.0)
      actionmailer (>= 3.0.0)
      postmark (~> 1.10.0)
    powerpack (0.1.1)
    pry (0.11.2)
      coderay (~> 1.1.0)
      method_source (~> 0.9.0)
    pry-byebug (3.5.0)
      byebug (~> 9.1)
      pry (~> 0.10)
    pry-rails (0.3.6)
      pry (>= 0.10.4)
    public_suffix (3.0.0)
    puma (3.10.0)
    rack (1.6.8)
    rack-canonical-host (0.2.2)
      addressable (> 0, < 3)
      rack (>= 1.0.0, < 3)
    rack-test (0.6.3)
      rack (>= 1.0)
    rack-timeout (0.4.2)
    rails (4.2.10)
      actionmailer (= 4.2.10)
      actionpack (= 4.2.10)
      actionview (= 4.2.10)
      activejob (= 4.2.10)
      activemodel (= 4.2.10)
      activerecord (= 4.2.10)
      activesupport (= 4.2.10)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.10)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.8)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    railties (4.2.10)
      actionpack (= 4.2.10)
      activesupport (= 4.2.10)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rainbow (2.2.2)
      rake
    rake (12.2.1)
    representable (3.0.3)
      declarative (< 0.1.0)
      declarative-option (< 0.2.0)
      uber (< 0.2.0)
    responders (2.3.0)
      railties (>= 4.2.0, < 5.1)
    retriable (3.0.1)
    rollbar (2.14.1)
      multi_json
    rspec (3.7.0)
      rspec-core (~> 3.7.0)
      rspec-expectations (~> 3.7.0)
      rspec-mocks (~> 3.7.0)
    rspec-collection_matchers (1.1.3)
      rspec-expectations (>= 2.99.0.beta1)
    rspec-core (3.7.0)
      rspec-support (~> 3.7.0)
    rspec-expectations (3.7.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.7.0)
    rspec-mocks (3.7.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.7.0)
    rspec-rails (3.7.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.7.0)
      rspec-expectations (~> 3.7.0)
      rspec-mocks (~> 3.7.0)
      rspec-support (~> 3.7.0)
    rspec-support (3.7.0)
    rubinius-actor (0.0.2)
      rubinius-core-api
    rubinius-core-api (0.0.1)
    rubocop (0.47.1)
      parser (>= 2.3.3.1, < 3.0)
      powerpack (~> 0.1)
      rainbow (>= 1.99.1, < 3.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (~> 1.0, >= 1.0.1)
    ruby-progressbar (1.9.0)
    rubyzip (1.2.1)
    safe_yaml (1.0.4)
    sass (3.4.23)
    sass-rails (5.0.6)
      railties (>= 4.0.0, < 6)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    selenium-webdriver (3.7.0)
      childprocess (~> 0.5)
      rubyzip (~> 1.0)
    shoulda-matchers (3.1.1)
      activesupport (>= 4.0.0)
    spring (2.0.2)
      activesupport (>= 4.2)
    spring-commands-cucumber (1.0.1)
      spring (>= 0.9.1)
    spring-commands-rspec (1.0.4)
      spring (>= 0.9.1)
    sprockets (3.7.1)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    thor (0.20.0)
    thread_safe (0.3.6)
    tilt (2.0.7)
    typhoeus (1.1.2)
      ethon (>= 0.9.0)
    tzinfo (1.2.4)
      thread_safe (~> 0.1)
    uber (0.1.0)
    uglifier (3.1.10)
      execjs (>= 0.3.0, < 3)
    unicode-display_width (1.3.0)
    uniform_notifier (1.10.0)
    warden (1.2.7)
      rack (>= 1.0)
    webmock (3.1.0)
      addressable (>= 2.3.6)
      crack (>= 0.3.2)
      hashdiff
    websocket-driver (0.7.0)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.2)
    xpath (2.1.0)
      nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  awesome_print
  aws-sdk (~> 2)
  axlsx!
  bullet
  business_time
  capybara
  chronic
  coffee-rails
  cucumber-rails
  database_cleaner
  devise
  dotenv-rails
  dynamic_form
  eco
  factory_girl_rails
  faker
  girl_friday
  google-api-client
  haml
  jasmine (~> 1.3)
  jasmine-rails
  jbuilder
  jquery-rails (~> 2.0.0)
  json
  launchy
  newrelic_rpm
  nokogiri
  nori
  oj
  omniauth
  omniauth-github
  omniauth-google-oauth2
  omniauth-instagram
  pg
  poltergeist
  postmark-rails
  pry-byebug
  pry-rails
  puma
  rack-canonical-host
  rack-timeout
  rails (~> 4.2.10)
  rollbar
  rspec-collection_matchers
  rspec-rails
  rubocop (~> 0.47.1)
  sass-rails
  shoulda-matchers
  signet!
  spring
  spring-commands-cucumber
  spring-commands-rspec
  typhoeus
  uglifier
  webmock

RUBY VERSION
   ruby 2.4.2p198

BUNDLED WITH
   1.16.0
@mattbrictson
Copy link
Contributor

Easily reproducible with these steps (bundler-audit was chosen because it has a dependency on bundler, which triggers the bug):

$ bundle init
Writing new Gemfile to /Users/mbrictson/Gemfile
$ echo 'gem "bundler-audit", :group => :development' >> Gemfile 
$ bundle install
Fetching gem metadata from https://rubygems.org/..
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using bundler 1.16.0
Using thor 0.20.0
Using bundler-audit 0.6.0
Bundle complete! 1 Gemfile dependency, 3 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
$ bundle update --group=development
...
NoMethodError: undefined method `version' for nil:NilClass

Proposed fix: #6157

bundlerbot added a commit that referenced this issue Nov 8, 2017
…oup, r=indirect

Fix NoMethodError during `bundle update --group`

### What was the end-user problem that led to this PR?

#6156: NoMethodError: undefined method `version' for nil:NilClass

### What was your diagnosis of the problem?

The `bundler` gem does not participate in the lockfile, but it can still be included in the list of dependencies that are being updated by `bundle update` if `--group` is specified.

For example, if a Gemfile contains `bundler-audit` (which depends on `bundler`) in the `:development` group, then updating with the option `--group=development` will naturally include `bundler` in the list of gems to evaluate for updating.

The trouble is that since `bundler` is excluded from the lockfile, searching the locked gems for a gemspec for bundler will return `nil`. This caused the following error during `bundle update`:

    NoMethodError: undefined method `version' for nil:NilClass

### What is your fix for the problem, implemented in this PR?

This PR solves this bug by skipping over gems (i.e `bundler`) that are not in the lockfile when comparing gem versions at the conclusion of the upgrade command.

Fixes #6156.

### Why did you choose this fix out of the possible options?

I chose this fix because the bug seems to have been introduced by 618c09b. My fix takes place within the new feature that was added in that commit, so it seems safe and unlikely to have side-effects.
hsbt pushed a commit to hsbt/bundler that referenced this issue Dec 11, 2017
…pdate-group, r=indirect

Fix NoMethodError during `bundle update --group`

### What was the end-user problem that led to this PR?

rubygems#6156: NoMethodError: undefined method `version' for nil:NilClass

### What was your diagnosis of the problem?

The `bundler` gem does not participate in the lockfile, but it can still be included in the list of dependencies that are being updated by `bundle update` if `--group` is specified.

For example, if a Gemfile contains `bundler-audit` (which depends on `bundler`) in the `:development` group, then updating with the option `--group=development` will naturally include `bundler` in the list of gems to evaluate for updating.

The trouble is that since `bundler` is excluded from the lockfile, searching the locked gems for a gemspec for bundler will return `nil`. This caused the following error during `bundle update`:

    NoMethodError: undefined method `version' for nil:NilClass

### What is your fix for the problem, implemented in this PR?

This PR solves this bug by skipping over gems (i.e `bundler`) that are not in the lockfile when comparing gem versions at the conclusion of the upgrade command.

Fixes rubygems#6156.

### Why did you choose this fix out of the possible options?

I chose this fix because the bug seems to have been introduced by 618c09b. My fix takes place within the new feature that was added in that commit, so it seems safe and unlikely to have side-effects.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Mar 14, 2018
## 1.16.1 (2017-12-12)

Bugfixes:

  - avoid hanging on complex resolver errors ([#6114](rubygems/bundler#6114), @halfbyte)
  - avoid an error when running `bundle update --group` ([#6156](rubygems/bundler#6156), @mattbrictson)
  - ensure the resolver prefers non-pre-release gems when possible ([#6181](rubygems/bundler#6181), @greysteil)
  - include bundler's gemspec in the built gem ([#6165](rubygems/bundler#6165), @dr-itz)
  - ensure locally installed specs are not overriden by those in remote sources during dependency resolution ([#6072](rubygems/bundler#6072), @indirect)
  - ensure custom gemfiles are respected in generated binstubs (@pftg)
  - fail gracefully when loading a bundler-generated binstub when `bin/bundle` was not generated by bundler ([#6149](rubygems/bundler#6149), @hsbt)
  - allow `bundle init` to be run even when a parent directory contains a gemfile ([#6205](rubygems/bundler#6205), @colby-swandale)

## 1.16.0 (2017-10-31)

Bugfixes:

  - avoid new RubyGems warning about unsafe YAML loading (to keep output consistent) (@segiddins)
  - load digest subclasses in a thread-safe manner (@segiddins, @colby-swandale)
  - avoid unusued variable warnings under ruby 2.5 (@amatsuda)
  - fix printing the same message twice in verbose mode ([#6028](rubygems/bundler#6028), @akhramov)
  - allow `SignalException`s to bubble up to the interpreter during `bundle exec` ([#6090](rubygems/bundler#6090), @dekellum)
  - avoid activating stdlib digest under Ruby 2.5 (@segiddins)
  - prioritise explicitly requested gems in dependency resolution sort order (@segiddins)
  - reduce memory usage during dependency resolution ([#6114](rubygems/bundler#6114), @greysteil)
  - ensure that the default bundler gem is not accidentally activated on ruby 2.5 when using local git overrides (@segiddins)

## 1.16.0.pre.3 (2017-10-04)

Features:

  - the output from `bundle env` includes more information, particularly both the compiled & loaded versions of OpenSSL (@indirect)

Bugfixes:

  - fix a bug where installing on FreeBSD would accidentally raise an error (#6013, @olleolleolle)
  - fix a regression in 1.16 where pre-release gems could accidentally be resolved even when the gemfile contained no pre-release requirements (@greysteil)
  - bundler will avoid making unnecessary network requests to fetch dependency data, fixing a regression introduced in 1.16 (@segiddins)
  - the outdated bundler version message is disabled by default until the message has been fine-tuned (#6004, @segiddins)

## 1.16.0.pre.2 (2017-09-06)

Bugfixes:

  - handle when a connection is missing a socket when warning about OpenSSL version (@greysteil)
  - the description for the `rake release` task now reflects `$RUBYGEMS_HOST` (@wadetandy)
  - fix a bug where `bundle update` would regress transitive dependencies (@greysteil)

## 1.16.0.pre.1 (2017-09-04)

Features:

  - allow using non-branch symbolic refs in a git source (#4845, @segiddins)
  - allow absolute paths in the `cache path` setting (#5627, @mal)
  - gems created via `bundle gem` with rspec have `--require spec_helper` in their `.rspec` file (@koic)
  - `bundle env` includes `Gem.ruby` and the `bundle` binstub shebang when they don't match (#5616, @segiddins)
  - allow passing gem names to `bundle pristine` (@segiddins)
  - `bundle version` and `bundle env` include the commit and build date for the bundler gem (#5049, @segiddins)
  - add the `--shebang` option to `bundle binstubs` (#4070, @segiddins, @zorbash)
  - gemfiles are `eval`ed one fewer time when running `bundle install` (#4952, #3096, #4417, @segiddins)
  - the `fileutils` gem is now vendored so different versions of the gem can be activated (@segiddins)
  - speed up no-op installations (#5842, @segiddins)
  - default to keeping the lockfile in the default gem template (@deivid-rodriguez)
  - add a special bundler binstub that ensures the correct version of bundler is activated (#5876, @segiddins)
  - speed up dependency resolution and ensure that all resolvable gemfiles can be installed (@segiddins, @greysteil)
  - add a `bundle list` command that prints the gems in use (#4754, @colby-swandale)
  - allow adding credentials to a gem source during deployment when `allow_deployment_source_credential_changes` is set (@adrian-gomez)
  - making an outdated (and insecure) TLS connection to rubygems.org will print a warning (@segiddins)

Bugfixes:

  - allow configuring a mirror fallback timeout without a trailing slash (#4830, @segiddins)
  - fix handling of mirrors for file: urls that contain upper-case characters (@segiddins)
  - list the correct gem host for `rake release` when `allowed_push_host` has been set (@mdeering)
  - ensure `Bundler.original_env` preserves all env keys that bundler sets (#5700, @segiddins)
  - ensure `bundle pristine` removes files added to a git gem (@segiddins)
  - load plugin files from path gems before gem installation (#5429, @segiddins)
  - ensure gems containing manpages are properly set up (#5730, @segiddins)
  - avoid fetching remote specs when all effected gems are in groups that are not being installed (@segiddins)
  - allow `BUNDLE_GEMFILE` to be a relative path (#5712, @gxespino)
  - show a more helpful error message when a gem fails to install due to a corrupted lockfile (#5846, @segiddins)
  - add a process lock to allow multiple concurrent `bundle install`s (#5851, @stefansedich)
  - ensure that specifications always return an array for `#extensions` (@greysteil)
  - print a helpful error message when using a gem in the Gemfile with an empty name (@colby-swandale)
  - ensure that all gemfiles are included in `bundle env` (@segiddins)
  - use ssl client cert and ca cert settings from gem configuration as fallbacks (@stan3)
  - avoid global namespace pollution when loading gems (#5958, @shyouhei)
  - avoid running a complete re-resolve on `bundle update --bundler` (@segiddins)
  - allow `bundle binstubs --standalone` to work without `path` being set (@colby-swandale)
  - fix support for bundle paths that include jars or wars on jruby (#5975, @torcido)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants