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

block in next_doc_module_group': undefined local variable or method _1' for Jazzy::SourceKitten:Module (NameError) #1388

Closed
nabhanh opened this issue May 21, 2024 · 4 comments · Fixed by #1389
Labels

Comments

@nabhanh
Copy link

nabhanh commented May 21, 2024

I am trying to generate docs for a XCode Project. The jazzy command builds the code using xcode build and then starts generating the docs for each file but at the end this is the error.

/Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:922:in `block in next_doc_module_group': undefined local variable or method `_1' for Jazzy::SourceKitten:Module (NameError)
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:922:in `each'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:922:in `partition'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:922:in `next_doc_module_group'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:908:in `merge_code_declaration'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:792:in `merge_type_and_extensions'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:779:in `merge_declarations'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:686:in `block in deduplicate_declarations'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:684:in `each'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:684:in `flat_map'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:684:in `deduplicate_declarations'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/sourcekitten.rb:1089:in `parse'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/doc_builder.rb:157:in `build_docs_for_sourcekitten_output'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/lib/jazzy/doc_builder.rb:88:in `build'
	from /Library/Ruby/Gems/2.6.0/gems/jazzy-0.15.0/bin/jazzy:16:in `<top (required)>'
	from /usr/local/bin/jazzy:23:in `load'
	from /usr/local/bin/jazzy:23:in `<main>'
@nabhanh
Copy link
Author

nabhanh commented May 21, 2024

Additional Info:
Ruby Version: 2.6.10
Jazzy Version: 0.15.0
Config File:

# Ordered by output of `jazzy — help config`
output: docs
clean: true
xcodebuild_arguments:
  - -workspace
  - workspace_file_name
  - -scheme
  - schemename
  - CODE_SIGNING_ALLOWED = NO
  - CODE_SIGNING_REQUIRED = NO
  - CODE_SIGNING_IDENTITY = ""
readme: README.md
min_acl: public
theme: apple

I have not specified the module name here since it's the same as the scheme name

@johnfairh johnfairh added the bug label May 22, 2024
@johnfairh
Copy link
Collaborator

Looks like accidental breakage of Ruby 2.6 - the syntax is from 2.7.

This is still the version shipped with macOS which is why it's supposed to be supported despite being > two years EOL, will look at fixing.

For now you will need to update to a more modern version of Ruby or revert jazzy.

@nabhanh
Copy link
Author

nabhanh commented May 22, 2024

Thanks for that upgrading to Ruby v3 and installing Jazzy again worked!

@thePsguy
Copy link

thePsguy commented Jun 6, 2024

When is the next release planned? Is it possible to do a patch release for this fix?
Jazzy can't be used with Ruby 2.6 at the moment due to the latest version requirement:

ERROR: The latest version of jazzy is required to generate
        Swift and Objective-C reference docs.

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

Successfully merging a pull request may close this issue.

3 participants