Skip to content
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

ArgumentError: wrong number of arguments (given 1, expected 0) #6326

Closed
richardhussey opened this issue Jan 31, 2023 · 4 comments · Fixed by #6365 or #6366
Closed

ArgumentError: wrong number of arguments (given 1, expected 0) #6326

richardhussey opened this issue Jan 31, 2023 · 4 comments · Fixed by #6365 or #6366

Comments

@richardhussey
Copy link

Describe the problem as clearly as you can

Running bundle update results in the following error:

ArgumentError: wrong number of arguments (given 1, expected 0)

Did you try upgrading rubygems & bundler?

PS > ruby -v
ruby 3.2.0 (2022-12-25 revision a528908271) [x64-mingw-ucrt]

PS > gem update --system
Latest version already installed. Done.

PS > gem -v
3.4.5

PS > bundle update --bundler

This gives the same "ArgumentError" as the bundle update command on its own.

Post steps to reproduce the problem

Run the bundle update command.

PS > bundle update
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
--- ERROR REPORT TEMPLATE -------------------------------------------------------

ArgumentError: wrong number of arguments (given 1, expected 0)
Etc.

Which command did you run?

bundle update

What were you expecting to happen?

The Gemfile to be updated.

What actually happened?

ArgumentError: wrong number of arguments (given 1, expected 0)
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_range.rb:22:in `eql?'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_constraint.rb:20:in `eql?'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/term.rb:25:in `eql?'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb:23:in `relation'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/partial_solution.rb:28:in `satisfies?'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb:146:in `block (2 levels) in choose_package_version'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb:145:in `all?'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb:145:in `block in choose_package_version'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb:136:in `each'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb:136:in `choose_package_version'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb:41:in `work'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/pub_grub/lib/pub_grub/version_solver.rb:58:in `solve'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/resolver.rb:71:in `solve_versions'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/resolver.rb:32:in `start'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/definition.rb:554:in `start_resolution'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/definition.rb:534:in `block in materialize'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/definition.rb:528:in `loop'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/definition.rb:528:in `materialize'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/definition.rb:197:in `specs'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/installer.rb:231:in `ensure_specs_are_compatible!'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/installer.rb:83:in `block in run'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/process_lock.rb:12:in `block in lock'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/process_lock.rb:9:in `open'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/process_lock.rb:9:in `lock'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/installer.rb:71:in `run'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/installer.rb:23:in `install'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/cli/update.rb:78:in `run'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:310:in `block in update'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/settings.rb:131:in `temporary'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:309:in `update'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:28:in `start'
  C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/exe/bundle:45:in `block in <top (required)>'
  C:/Ruby32-x64/lib/ruby/site_ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
  C:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/bundler-2.4.6/exe/bundle:33:in `<top (required)>'
  C:/Ruby32-x64/bin/bundle:32:in `load'
  C:/Ruby32-x64/bin/bundle:32:in `<main>'

Environment

Bundler       2.4.6
  Platforms   ruby, x64-mingw-ucrt
Ruby          3.2.0p0 (2022-12-25 revision a528908271c678360d2d8ca232c178e7cdd340b4) [x64-mingw-ucrt]
  Full Path   C:/Ruby32-x64/bin/ruby.exe
  Config Dir  C:/ProgramData
RubyGems      3.4.6
  Gem Home    C:/Ruby32-x64/lib/ruby/gems/3.2.0
  Gem Path    {UserDirectory}/.gem/ruby/3.2.0;C:/Ruby32-x64/lib/ruby/gems/3.2.0
  User Home   {UserDirectory}/
  User Path   {UserDirectory}/.gem/ruby/3.2.0
  Bin Dir     C:/Ruby32-x64/bin
OpenSSL
  Compiled    OpenSSL 3.0.7 1 Nov 2022
  Loaded      OpenSSL 3.0.7 1 Nov 2022
  Cert File   C:/Ruby32-x64/ssl/cert.pem
  Cert Dir    C:/Ruby32-x64/ssl/certs
Tools
  Git         2.39.1.windows.1
  RVM         not installed
  rbenv       not installed
  chruby      not installed

Bundler Build Metadata

Built At          2023-01-31
Git SHA           598c04d54a
Released Version  true

Bundler settings

jobs
  Set for your local app ({GitRepo}/.bundle/config): 8

Gemfile

Gemfile

source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
#     bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
# gem "jekyll", "~> 4.1.1"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.12"
  gem "jekyll-sitemap"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
  gem "tzinfo", "~> 1.2"
  gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Missing gem from Ruby 3
gem "webrick", "~> 1.7"

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (6.0.6.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
      zeitwerk (~> 2.2, >= 2.2.2)
    addressable (2.8.1)
      public_suffix (>= 2.0.2, < 6.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.11.1)
    colorator (1.1.0)
    commonmarker (0.23.7)
    concurrent-ruby (1.2.0)
    dnsruby (1.61.9)
      simpleidn (~> 0.1)
    em-websocket (0.5.3)
      eventmachine (>= 0.12.9)
      http_parser.rb (~> 0)
    ethon (0.16.0)
      ffi (>= 1.15.0)
    eventmachine (1.2.7)
    eventmachine (1.2.7-x64-mingw32)
    execjs (2.8.1)
    faraday (2.7.1)
      faraday-net_http (>= 2.0, < 3.1)
      ruby2_keywords (>= 0.0.4)
    faraday-net_http (3.0.2)
    ffi (1.15.5)
    ffi (1.15.5-x64-mingw-ucrt)
    ffi (1.15.5-x64-mingw32)
    forwardable-extended (2.6.0)
    gemoji (3.0.1)
    github-pages (227)
      github-pages-health-check (= 1.17.9)
      jekyll (= 3.9.2)
      jekyll-avatar (= 0.7.0)
      jekyll-coffeescript (= 1.1.1)
      jekyll-commonmark-ghpages (= 0.2.0)
      jekyll-default-layout (= 0.1.4)
      jekyll-feed (= 0.15.1)
      jekyll-gist (= 1.5.0)
      jekyll-github-metadata (= 2.13.0)
      jekyll-include-cache (= 0.2.1)
      jekyll-mentions (= 1.6.0)
      jekyll-optional-front-matter (= 0.3.2)
      jekyll-paginate (= 1.1.0)
      jekyll-readme-index (= 0.3.0)
      jekyll-redirect-from (= 0.16.0)
      jekyll-relative-links (= 0.6.1)
      jekyll-remote-theme (= 0.4.3)
      jekyll-sass-converter (= 1.5.2)
      jekyll-seo-tag (= 2.8.0)
      jekyll-sitemap (= 1.4.0)
      jekyll-swiss (= 1.0.0)
      jekyll-theme-architect (= 0.2.0)
      jekyll-theme-cayman (= 0.2.0)
      jekyll-theme-dinky (= 0.2.0)
      jekyll-theme-hacker (= 0.2.0)
      jekyll-theme-leap-day (= 0.2.0)
      jekyll-theme-merlot (= 0.2.0)
      jekyll-theme-midnight (= 0.2.0)
      jekyll-theme-minimal (= 0.2.0)
      jekyll-theme-modernist (= 0.2.0)
      jekyll-theme-primer (= 0.6.0)
      jekyll-theme-slate (= 0.2.0)
      jekyll-theme-tactile (= 0.2.0)
      jekyll-theme-time-machine (= 0.2.0)
      jekyll-titles-from-headings (= 0.5.3)
      jemoji (= 0.12.0)
      kramdown (= 2.3.2)
      kramdown-parser-gfm (= 1.1.0)
      liquid (= 4.0.3)
      mercenary (~> 0.3)
      minima (= 2.5.1)
      nokogiri (>= 1.13.6, < 2.0)
      rouge (= 3.26.0)
      terminal-table (~> 1.4)
    github-pages-health-check (1.17.9)
      addressable (~> 2.3)
      dnsruby (~> 1.60)
      octokit (~> 4.0)
      public_suffix (>= 3.0, < 5.0)
      typhoeus (~> 1.3)
    html-pipeline (2.14.3)
      activesupport (>= 2)
      nokogiri (>= 1.4)
    http_parser.rb (0.8.0)
    i18n (0.9.5)
      concurrent-ruby (~> 1.0)
    jekyll (3.9.2)
      addressable (~> 2.4)
      colorator (~> 1.0)
      em-websocket (~> 0.5)
      i18n (~> 0.7)
      jekyll-sass-converter (~> 1.0)
      jekyll-watch (~> 2.0)
      kramdown (>= 1.17, < 3)
      liquid (~> 4.0)
      mercenary (~> 0.3.3)
      pathutil (~> 0.9)
      rouge (>= 1.7, < 4)
      safe_yaml (~> 1.0)
    jekyll-avatar (0.7.0)
      jekyll (>= 3.0, < 5.0)
    jekyll-coffeescript (1.1.1)
      coffee-script (~> 2.2)
      coffee-script-source (~> 1.11.1)
    jekyll-commonmark (1.4.0)
      commonmarker (~> 0.22)
    jekyll-commonmark-ghpages (0.2.0)
      commonmarker (~> 0.23.4)
      jekyll (~> 3.9.0)
      jekyll-commonmark (~> 1.4.0)
      rouge (>= 2.0, < 4.0)
    jekyll-default-layout (0.1.4)
      jekyll (~> 3.0)
    jekyll-feed (0.15.1)
      jekyll (>= 3.7, < 5.0)
    jekyll-gist (1.5.0)
      octokit (~> 4.2)
    jekyll-github-metadata (2.13.0)
      jekyll (>= 3.4, < 5.0)
      octokit (~> 4.0, != 4.4.0)
    jekyll-include-cache (0.2.1)
      jekyll (>= 3.7, < 5.0)
    jekyll-mentions (1.6.0)
      html-pipeline (~> 2.3)
      jekyll (>= 3.7, < 5.0)
    jekyll-optional-front-matter (0.3.2)
      jekyll (>= 3.0, < 5.0)
    jekyll-paginate (1.1.0)
    jekyll-readme-index (0.3.0)
      jekyll (>= 3.0, < 5.0)
    jekyll-redirect-from (0.16.0)
      jekyll (>= 3.3, < 5.0)
    jekyll-relative-links (0.6.1)
      jekyll (>= 3.3, < 5.0)
    jekyll-remote-theme (0.4.3)
      addressable (~> 2.0)
      jekyll (>= 3.5, < 5.0)
      jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
      rubyzip (>= 1.3.0, < 3.0)
    jekyll-sass-converter (1.5.2)
      sass (~> 3.4)
    jekyll-seo-tag (2.8.0)
      jekyll (>= 3.8, < 5.0)
    jekyll-sitemap (1.4.0)
      jekyll (>= 3.7, < 5.0)
    jekyll-swiss (1.0.0)
    jekyll-theme-architect (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-cayman (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-dinky (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-hacker (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-leap-day (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-merlot (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-midnight (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-minimal (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-modernist (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-primer (0.6.0)
      jekyll (> 3.5, < 5.0)
      jekyll-github-metadata (~> 2.9)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-slate (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-tactile (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-theme-time-machine (0.2.0)
      jekyll (> 3.5, < 5.0)
      jekyll-seo-tag (~> 2.0)
    jekyll-titles-from-headings (0.5.3)
      jekyll (>= 3.3, < 5.0)
    jekyll-watch (2.2.1)
      listen (~> 3.0)
    jemoji (0.12.0)
      gemoji (~> 3.0)
      html-pipeline (~> 2.2)
      jekyll (>= 3.0, < 5.0)
    kramdown (2.3.2)
      rexml
    kramdown-parser-gfm (1.1.0)
      kramdown (~> 2.0)
    liquid (4.0.3)
    listen (3.7.1)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    mercenary (0.3.6)
    mini_portile2 (2.8.0)
    minima (2.5.1)
      jekyll (>= 3.5, < 5.0)
      jekyll-feed (~> 0.9)
      jekyll-seo-tag (~> 2.1)
    minitest (5.17.0)
    nokogiri (1.13.10)
      mini_portile2 (~> 2.8.0)
      racc (~> 1.4)
    octokit (4.25.1)
      faraday (>= 1, < 3)
      sawyer (~> 0.9)
    pathutil (0.16.2)
      forwardable-extended (~> 2.6)
    public_suffix (4.0.7)
    racc (1.6.1)
    rb-fsevent (0.11.2)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    rexml (3.2.5)
    rouge (3.26.0)
    ruby2_keywords (0.0.5)
    rubyzip (2.3.2)
    safe_yaml (1.0.5)
    sass (3.7.4)
      sass-listen (~> 4.0.0)
    sass-listen (4.0.0)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    sawyer (0.9.2)
      addressable (>= 2.3.5)
      faraday (>= 0.17.3, < 3)
    simpleidn (0.2.1)
      unf (~> 0.1.4)
    terminal-table (1.8.0)
      unicode-display_width (~> 1.1, >= 1.1.1)
    thread_safe (0.3.6)
    typhoeus (1.4.0)
      ethon (>= 0.9.0)
    tzinfo (1.2.10)
      thread_safe (~> 0.1)
    tzinfo-data (1.2022.7)
      tzinfo (>= 1.0.0)
    unf (0.1.4)
      unf_ext
    unf_ext (0.0.8.2)
    unicode-display_width (1.8.0)
    wdm (0.1.1)
    webrick (1.7.0)
    zeitwerk (2.6.6)

PLATFORMS
  x64-mingw-ucrt
  x64-mingw32
  x64-unknown
  x86_64-linux

DEPENDENCIES
  github-pages
  jekyll-feed (~> 0.12)
  jekyll-sitemap
  minima (~> 2.5)
  tzinfo (~> 1.2)
  tzinfo-data
  wdm (~> 0.1.1)
  webrick (~> 1.7)

BUNDLED WITH
   2.3.7

If not included with the output of your command, run bundle env and paste the output below

Included above.

@deivid-rodriguez
Copy link
Member

Thank you, it seems like a "typo" in PubGrub, where the VersionRange::Empty class implements an #eql? method that takes no parameters: https://github.com/jhawthorn/pub_grub/blob/7742438b892329bf1f817d52e452c3646faead6f/lib/pub_grub/version_range.rb#L22.

I'll provide a fix.

@cfis
Copy link
Contributor

cfis commented Feb 4, 2023

Saw this after creating an issue on pub_grup.

See jhawthorn/pub_grub#26

@composerinteralia
Copy link
Contributor

composerinteralia commented Feb 8, 2023

I was playing around with this and found a smaller repro, in case it's helpful for writing a failing test:

source "https://rubygems.org"
gem "google-protobuf"
gem "unf_ext"
GEM
  remote: https://rubygems.org/
  specs:
    google-protobuf (3.21.12)
    unf_ext (0.0.8.2)

PLATFORMS
  x64-mingw-ucrt
  x64-mingw32

DEPENDENCIES
  google-protobuf
  unf_ext

BUNDLED WITH
   2.4.6

Running bundle update fails

The PLATFORMS seem to be significant.

@deivid-rodriguez
Copy link
Member

Thanks to the helpful repro by @composerinteralia I managed to write a spec for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants