Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

2.8.6: NoMethodError "undefined method 'first'" in profdata_coverage_dir whenever --scheme is used

Open Beginner friendly
#586 4 comments 4 reactions 0 assignees View on GitHub

@MirekNalepa is already working on this.

Since Oct 12, 2026.

  • #587 by @MirekNalepa — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ruby
Domain
tooling

Research direction

Start with Project#profdata_coverage_dir at lib/slather/project.rb:237, identified by the stack trace, and trace how --scheme selects the coverage directory. Reproduce with the documented slather coverage command on an Xcode workspace, then confirm the command generates a coverage report without raising NoMethodError.

Written by the indexing model from the issue text.

Description

Since 2.8.6, any slather coverage run with a scheme (--scheme or scheme: in .slather.yml) fails in Project#profdata_coverage_dir with a NoMethodError.
2.8.5 works with the same project and command.

Environment
slather: 2.8.6 (works on 2.8.5)
Ruby: 4.0.7
Xcode: 26.2
CI: Azure Pipelines, Microsoft-hosted macOS agent
macOS: macos-latest

Steps to reproduce

  1. Run tests with code coverage enabled for an Xcode workspace.
  2. Run:
gem install slather -v 2.8.6
slather coverage --cobertura-xml --output-directory test-reports/xml --scheme <SchemeName>

Expected
A coverage report is generated, as it is on 2.8.5.

Actual

/usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/project.rb:237:in `profdata_coverage_dir': undefined method `first' for nil (NoMethodError)
          end.first
             ^^^^^^
	from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/project.rb:568:in `find_binary_files'
	from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/project.rb:498:in `configure_binary_file'
	from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/project.rb:370:in `configure'
	from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/lib/slather/command/coverage_command.rb:62:in `execute'
	from /usr/local/lib/ruby/gems/3.3.0/gems/clamp-1.5.2/lib/clamp/command.rb:66:in `run'
	from /usr/local/lib/ruby/gems/3.3.0/gems/clamp-1.5.2/lib/clamp/subcommand/execution.rb:18:in `execute'
	from /usr/local/lib/ruby/gems/3.3.0/gems/clamp-1.5.2/lib/clamp/command.rb:66:in `run'
	from /usr/local/lib/ruby/gems/3.3.0/gems/clamp-1.5.2/lib/clamp/command.rb:140:in `run'
	from /usr/local/lib/ruby/gems/3.3.0/gems/slather-2.8.6/bin/slather:17:in `<top (required)>'
	from /usr/local/lib/ruby/site_ruby/3.3.0/rubygems.rb:305:in `load'
	from /usr/local/lib/ruby/site_ruby/3.3.0/rubygems.rb:305:in `activate_and_load_bin_path'
	from /usr/local/lib/ruby/gems/3.3.0/bin/slather:25:in `<main>'
undefined method `first' for nil
Dominant language
Ruby
Stars
1.6k
Forks
239
Avg merge
10h 19m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SlatherOrg/slather

All issues in SlatherOrg/slather

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.