New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: undefined method<=>' for nil:NilClass (NoMethodError) on Travis CI with Ruby 1.8.7 #2784

Closed
floehopper opened this Issue Dec 28, 2013 · 8 comments

Comments

Projects
None yet
5 participants
@floehopper

floehopper commented Dec 28, 2013

I've just started seeing a fatal bundler error with Ruby 1.8.7, but not with Ruby 1.9.3 or Ruby 2.0.0. Fatal error in Ruby 1.8.7 vs No fatal error in Ruby 1.9.3.

  • The fatal error I'm seeing happens early on within the bundle install command (see stack trace below): undefined method``<=>' for nil:NilClass (NoMethodError).
  • The failing combination on Travis CI is ruby 1.8.7-p374, rubygems 2.2.0 & bundler 1.5.0.
  • I tried reverting the commit after which the build started failing, but that made no difference.
  • I've set DEBUG=true and DEBUG_RESOLVER=true but neither of them give me any more clues.
  • I've tried to reproduce the error locally with exactly the same version of Ruby, Rubygems & Bundler, but no luck - although I'm using rbenv not rvm and OSX not Linux.

I'd be grateful for any idea on how to further diagnose the problem e.g. any more debug flags I can switch on for Rubygems or Bundler.

See travis-ci/travis-ci#1793.

Stack trace:

/home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/specification.rb:325:in `sort': undefined method `<=>' for nil:NilClass (NoMethodError)
  from /home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/specification.rb:325:in `files'
  from /home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/specification.rb:2155:in `send'
  from /home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/specification.rb:2155:in `same_attributes?'
  from /home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:55:in `all?'
  from /home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/specification.rb:2155:in `each'
  from /home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/specification.rb:2155:in `all?'
  from /home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/specification.rb:2155:in `same_attributes?'
  from /home/travis/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/specification.rb:1650:in `eql?'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/index.rb:109:in `-'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/index.rb:109:in `use'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/index.rb:90:in `each'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/index.rb:90:in `each'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/index.rb:89:in `each'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/index.rb:106:in `use'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/source/rubygems.rb:171:in `fetch_specs'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/source/rubygems.rb:67:in `specs'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/definition.rb:216:in `index'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/definition.rb:213:in `each'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/definition.rb:213:in `index'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/index.rb:9:in `build'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/definition.rb:209:in `index'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/definition.rb:203:in `resolve'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/definition.rb:133:in `specs'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/definition.rb:122:in `resolve_remotely!'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/installer.rb:82:in `run'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/installer.rb:15:in `install'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/cli.rb:257:in `install'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/vendor/thor/command.rb:27:in `__send__'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/vendor/thor/command.rb:27:in `run'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_command'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/vendor/thor.rb:363:in `dispatch'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/vendor/thor/base.rb:438:in `start'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/cli.rb:10:in `start'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/bin/bundle:22
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.0/bin/bundle:22
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/bin/bundle:23:in `load'
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/bin/bundle:23
  from /home/travis/.rvm/gems/ruby-1.8.7-p374@global/bin/ruby_executable_hooks:15
@roidrage

This comment has been minimized.

Show comment
Hide comment
@roidrage

roidrage Dec 28, 2013

Interestingly, just got a similar report on JRuby in 1.8 mode: https://gist.github.com/madrobby/8160300

roidrage commented Dec 28, 2013

Interestingly, just got a similar report on JRuby in 1.8 mode: https://gist.github.com/madrobby/8160300

@madrobby

This comment has been minimized.

Show comment
Hide comment
@madrobby

madrobby Dec 28, 2013

I see the same thing, but only in some projects. Happens with 1.8.7 and REE.

Here's a working log (1.8.7): https://travis-ci.org/madrobby/zaru/jobs/16072600
Here's a failing log (1.8.7): https://travis-ci.org/cheerful/URLcrypt/jobs/16072674

The build that breaks uses the coveralls gem, whereas the other build doesn't, so perhaps it's related to that.

gem 'coveralls', :require => false

madrobby commented Dec 28, 2013

I see the same thing, but only in some projects. Happens with 1.8.7 and REE.

Here's a working log (1.8.7): https://travis-ci.org/madrobby/zaru/jobs/16072600
Here's a failing log (1.8.7): https://travis-ci.org/cheerful/URLcrypt/jobs/16072674

The build that breaks uses the coveralls gem, whereas the other build doesn't, so perhaps it's related to that.

gem 'coveralls', :require => false
@floehopper

This comment has been minimized.

Show comment
Hide comment
@floehopper

floehopper Dec 28, 2013

I think @pixeltrix has nailed it. I'm just trying an earlier version of Rubygems to see if that fixes the problem. Then I'll submit a PR.

floehopper commented Dec 28, 2013

I think @pixeltrix has nailed it. I'm just trying an earlier version of Rubygems to see if that fixes the problem. Then I'll submit a PR.

floehopper added a commit to floehopper/rubygems that referenced this issue Dec 28, 2013

Sort files *after* compacting them to avoid problem in Ruby 1.8.7
Pull request rubygems#612 introduced sorting of `Gem::Specification#files`.

However, as @pixeltrix pointed out in [1,2], `nil#<=>` is not defined in Ruby
versions before v1.9.3. By doing the `#sort` *after* the `#compact`, we can
avoid this problem without changing the behaviour.

This was causing a fatal Bundler error in my Ruby v1.8.7 builds on Travis CI.
See [3] for an example of the fatal error.

See also my initial issue on Travis CI [4] and subsequent issue on Bundler [5].

[1] https://twitter.com/pixeltrix/status/416950629786189824
[2] https://twitter.com/pixeltrix/status/416950640242622465
[3] https://travis-ci.org/freerange/mocha/jobs/16068647#L50
[4] travis-ci/travis-ci#1793
[5] bundler/bundler#2784
@floehopper

This comment has been minimized.

Show comment
Hide comment
@floehopper

floehopper Dec 28, 2013

This turns out to be a bug in Rubygems. I've submitted a PR to Rubygems - rubygems/rubygems#763. Closing this issue.

floehopper commented Dec 28, 2013

This turns out to be a bug in Rubygems. I've submitted a PR to Rubygems - rubygems/rubygems#763. Closing this issue.

@floehopper floehopper closed this Dec 28, 2013

@floehopper

This comment has been minimized.

Show comment
Hide comment
@floehopper

floehopper Dec 28, 2013

@roidrage & @madrobby you might find my Travis CI workaround useful - freerange/mocha@66bab2a.

floehopper commented Dec 28, 2013

@roidrage & @madrobby you might find my Travis CI workaround useful - freerange/mocha@66bab2a.

@supermarin

This comment has been minimized.

Show comment
Hide comment
@supermarin

supermarin commented Dec 29, 2013

@floehopper thank you!

@pboling

This comment has been minimized.

Show comment
Hide comment
@pboling

pboling Dec 30, 2013

I just hit this in my build here: https://travis-ci.org/pboling/sanitize_email/jobs/16151464

I am attempting to add 1.8.7 back to my Travis build. My suite runs fine in 1.8.7 locally, however that is running bundler (1.3.5)

I am also using coveralls.

    require 'coveralls'
    Coveralls.wear!

pboling commented Dec 30, 2013

I just hit this in my build here: https://travis-ci.org/pboling/sanitize_email/jobs/16151464

I am attempting to add 1.8.7 back to my Travis build. My suite runs fine in 1.8.7 locally, however that is running bundler (1.3.5)

I am also using coveralls.

    require 'coveralls'
    Coveralls.wear!

yaauie added a commit to resque/resque that referenced this issue Jan 1, 2014

Use rubygems v2.1.11 for travis; works around rubygems/rubygems#763
This commit can safely be reverted when rubygems 2.2.1 is released.
HT to @floehopper sharing for his [solution][1].

[1]: bundler/bundler#2784 (comment)

eventualbuddha added a commit to fakefs/fakefs that referenced this issue Jan 3, 2014

Use rubygems 2.1.11 until 2.2.1 is released.
This is only for TravisCI and works around a rubygems/bundler incompatibility: bundler/bundler#2784 (comment).

thefooj added a commit to thefooj/bipbip that referenced this issue Jan 3, 2014

rcook added a commit to rcook/attr_encrypted that referenced this issue Jan 4, 2014

ajohnstone added a commit to ajohnstone/puppet-module-common that referenced this issue Jan 4, 2014

ghoneycutt added a commit to ghoneycutt/puppet-module-nrpe that referenced this issue Jan 5, 2014

AndyObtiva added a commit to AndyObtiva/abstract_feature_branch that referenced this issue Jan 6, 2014

Update .travis.yml
Excluding Ruby 1.8.7 temporarily as it is causing Travis CI issues with Coveralls and Bundler (bundler/bundler#2784)

pglombardo added a commit to tracelytics/ruby-traceview that referenced this issue Jan 6, 2014

ruedap added a commit to ruedap/alfred-font-awesome-workflow that referenced this issue Jan 7, 2014

ghoneycutt added a commit to ghoneycutt/puppet-module-rsyslog that referenced this issue Jan 8, 2014

karmi added a commit to elastic/elasticsearch-ruby that referenced this issue Jan 8, 2014

thefooj added a commit to thefooj/bipbip that referenced this issue Jan 8, 2014

@jch jch referenced this issue Jan 9, 2014

Merged

Bump version 1.2.0 #97

eabecho pushed a commit to eabecho/puppet-module-vas that referenced this issue Jan 9, 2014

ghoneycutt added a commit to ghoneycutt/puppet-module-puppet that referenced this issue Jan 9, 2014

yasuhito added a commit to trema/trema that referenced this issue Jan 10, 2014

ghoneycutt added a commit to ghoneycutt/puppet-module-types that referenced this issue Jan 10, 2014

caius added a commit to caius/fakeredis that referenced this issue Jan 11, 2014

caius added a commit to caius/fakeredis that referenced this issue Jan 11, 2014

caius added a commit to guilleiguaran/fakeredis that referenced this issue Jan 11, 2014

Temporary fix for rb 1.8.7 on Travis CI
Ruby 1.8.7 is broken otherwise, but doing this fixes it. No harm in running it for other rubies either.

See bundler/bundler#2784 and travis-ci/travis-ci#1793 for more context on the bug.

We should revert this once Travis has fixed it and rolled the fix out.

ghoneycutt added a commit to ghoneycutt/puppet-module-nfs that referenced this issue Jan 14, 2014

ghoneycutt added a commit to ghoneycutt/puppet-module-facter that referenced this issue Jan 23, 2014

floehopper added a commit to freerange/mocha.methods that referenced this issue Mar 14, 2014

floehopper added a commit to freerange/mocha.methods that referenced this issue Mar 14, 2014

AndyObtiva added a commit to AndyObtiva/abstract_feature_branch that referenced this issue Jul 26, 2018

Update .travis.yml
Excluding Ruby 1.8.7 temporarily as it is causing Travis CI issues with Coveralls and Bundler (bundler/bundler#2784)

AndyObtiva added a commit to AndyObtiva/abstract_feature_branch that referenced this issue Jul 26, 2018

Update .travis.yml
Excluding Ruby 1.8.7 temporarily as it is causing Travis CI issues with Coveralls and Bundler (bundler/bundler#2784)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment