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

Crash: undefined method `[]' for false:FalseClass - can't detect scheme from CLI

Open
#496 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
ios, ruby
Domain
cli

Research direction

Start with lib/slather/project.rb around configure_scheme at line 398, identified by the stack trace, and trace how the CLI --scheme value reaches that method. Compare that path with scheme loading from .slather.yml, which the reporter says works. Reproduce with the supplied slather coverage command and confirm the CLI invocation handles the scheme without crashing.

Written by the indexing model from the issue text.

Description

I found the following error:

Slathering...
undefined method `[]' for false:FalseClass

	Are you sure your project is generating coverage? Make sure you enable code coverage in the Test section of your Xcode scheme.
	Did you specify your Xcode scheme? (--scheme or 'scheme' in .slather.yml)
	If you're using a workspace, did you specify it? (--workspace or 'workspace' in .slather.yml)
	If you use a different Xcode configuration, did you specify it? (--configuration or 'configuration' in .slather.yml)
Click to see stacktrace

Traceback (most recent call last):
	24: from /Users/rogerluan/.rbenv/versions/2.6.5/bin/bundle:23:in `<main>'
	23: from /Users/rogerluan/.rbenv/versions/2.6.5/bin/bundle:23:in `load'
	22: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.2.17/exe/bundle:37:in `<top (required)>'
	21: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
	20: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/bundler-2.2.17/exe/bundle:49:in `block in <top (required)>'
	19: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:24:in `start'
	18: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	17: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:30:in `dispatch'
	16: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	15: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	14: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	13: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli.rb:494:in `exec'
	12: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:28:in `run'
	11: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:63:in `kernel_load'
	10: from /Users/rogerluan/.rbenv/versions/2.6.5/lib/ruby/site_ruby/2.6.0/bundler/cli/exec.rb:63:in `load'
	 9: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/bin/slather:23:in `<top (required)>'
	 8: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/bin/slather:23:in `load'
	 7: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/slather-2.7.1/bin/slather:17:in `<top (required)>'
	 6: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/clamp-1.3.2/lib/clamp/command.rb:140:in `run'
	 5: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
	 4: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute'
	 3: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
	 2: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/slather-2.7.1/lib/slather/command/coverage_command.rb:59:in `execute'
	 1: from /Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/slather-2.7.1/lib/slather/project.rb:324:in `configure'
/Users/rogerluan/Documents/Projects/iOS/.vendor/ruby/2.6.0/gems/slather-2.7.1/lib/slather/project.rb:398:in `configure_scheme': undefined method `[]' for false:FalseClass (NoMethodError)

When executing:

bundle exec slather coverage \
      --cobertura-xml \
      --scheme MyProject-Package \ 
      --source-directory Sources \
      --binary-basename MyProject \     
      --output-directory Generated \
      --ignore 'Tests/*' \
      MyProject.xcodeproj

As you can see in the stacktrace, the crash is here: https://github.com/SlatherOrg/slather/blob/13d50220de561e5f89d3d3685ce94601cdbb196d/lib/slather/project.rb#L398

Apparently it's not picking up the --scheme argument correctly. I tried adding single and double quotes around the scheme value, with no luck.

But if I use a .slather.yml with a scheme, then everything works.

I did a quick code review but I couldn't spot the bug in the slather codebase

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.