ruby/rubygems · error · Gem::CommandLineError
Too many arguments
Error message
Too many arguments
What it means
Error "Too many arguments" thrown in ruby/rubygems.
Source
Thrown at lib/rubygems/commands/rebuild_command.rb:181
end
def prep_dirs
rebuild_dir = Dir.mktmpdir("gem_rebuild")
old_dir = File.join(rebuild_dir, "old")
new_dir = File.join(rebuild_dir, "new")
FileUtils.mkdir_p(old_dir)
FileUtils.mkdir_p(new_dir)
[old_dir, new_dir]
end
def get_gem_name_and_version
args = options[:args] || []
if args.length == 2
gem_name, gem_version = args
elsif args.length > 2
raise Gem::CommandLineError, "Too many arguments"
else
raise Gem::CommandLineError, "Expected GEM_NAME and GEM_VERSION arguments (gem rebuild GEM_NAME GEM_VERSION)"
end
[gem_name, gem_version]
end
def build_gem(gem_name, source_date_epoch, output_file)
gemspec = options[:gemspec_file] || find_gemspec("#{gem_name}.gemspec")
if gemspec
build_package(gemspec, source_date_epoch, output_file)
else
alert_error error_message(gem_name)
terminate_interaction(1)
end
end
View on GitHub (pinned to 86cbb817a3)
When it happens
Trigger: Thrown at lib/rubygems/commands/rebuild_command.rb:181 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23).
Data as JSON: /api/errors/1c97288176b7356b.
Report an issue: GitHub.