Skip to content

Recurring uninitialized constant JSON::Ext::ParserConfig error #19553

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

Closed
3 tasks done
mahrud opened this issue Mar 20, 2025 · 17 comments
Closed
3 tasks done

Recurring uninitialized constant JSON::Ext::ParserConfig error #19553

mahrud opened this issue Mar 20, 2025 · 17 comments
Labels
stale No recent activity

Comments

@mahrud
Copy link
Contributor

mahrud commented Mar 20, 2025

brew doctor output

$ brew doctor
Error: uninitialized constant JSON::Ext::ParserConfig
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:32:in `<module:Ext>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:8:in `<module:JSON>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:5:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:586:in `<module:JSON>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:584:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cask/config.rb:4:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:6:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:50:in `<main>'

Now, if I do the following:

cd /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew
rm -rf vendor
git checkout .
brew update
brew doctor

I get:

$ brew doctor
Your system is ready to brew.

Verification

  • My "brew doctor output" above says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update twice and am still able to reproduce my issue.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

brew config
Error: uninitialized constant JSON::Ext::ParserConfig
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:32:in `<module:Ext>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:8:in `<module:JSON>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:5:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:586:in `<module:JSON>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:584:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cask/config.rb:4:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:6:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:50:in `<main>'

After the same workaround as above, I get:

$ brew config
HOMEBREW_VERSION: 4.4.24-291-gf3bd91d
ORIGIN: https://github.com/Homebrew/brew
HEAD: f3bd91d3afe086824d24708230e1f0c7f943135a
Last commit: 2 hours ago
Branch: master
Core tap HEAD: a374670ca946736bbb383555609414a9d41c5f1a
Core tap last commit: 56 minutes ago
Core tap JSON: 20 Mar 09:39 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: :0
HOMEBREW_EDITOR: emacs
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 8
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.7 => /usr/bin/ruby
CPU: octa-core 64-bit skylake
Clang: 19.1.7
Git: 2.48.1 => /bin/git
Curl: 8.6.0 => /bin/curl
Kernel: Linux 6.13.6-100.fc40.x86_64 x86_64 GNU/Linux
OS: Fedora release 40 (Forty)
Host glibc: 2.39
/usr/bin/gcc: 14.2.1
/usr/bin/ruby: 3.3.7
glibc: N/A
gcc@11: N/A
gcc: 14.2.0_1
xorg: N/A

What were you trying to do (and why)?

This issue seems to be happening during various brew calls, such as audit, style, bump-formula-pr, ...

What happened (include all command output)?

$ brew bump-formula-pr msolve --version 0.7.5
==> Installing 'bundler' gem
Fetching bundler-2.5.20.gem
Fetching gem metadata from https://rubygems.org/.......
Fetching public_suffix 6.0.1
Fetching ast 2.4.2
Fetching base64 0.2.0
Fetching bindata 2.5.0
Installing base64 0.2.0
Installing ast 2.4.2
Fetching concurrent-ruby 1.3.5
Installing bindata 2.5.0
Installing public_suffix 6.0.1
Fetching json 2.10.2
Installing json 2.10.2 with native extensions
Fetching language_server-protocol 3.17.0.4
Installing language_server-protocol 3.17.0.4
Installing concurrent-ruby 1.3.5
Fetching lint_roller 1.1.0
Installing lint_roller 1.1.0
Fetching parallel 1.26.3
Installing parallel 1.26.3
Fetching racc 1.8.1
Installing racc 1.8.1 with native extensions
Fetching plist 3.7.2
Installing plist 3.7.2
Fetching rainbow 3.1.1
Installing rainbow 3.1.1
Fetching regexp_parser 2.10.0
Installing regexp_parser 2.10.0
Fetching rexml 3.4.1
Installing rexml 3.4.1
Fetching ruby-progressbar 1.13.0
Installing ruby-progressbar 1.13.0
Fetching unicode-emoji 4.0.4
Fetching ruby-macho 4.1.0
Installing ruby-macho 4.1.0
Installing unicode-emoji 4.0.4
Fetching sorbet-runtime 0.5.11945
Installing sorbet-runtime 0.5.11945
Fetching warning 1.5.0
Installing warning 1.5.0
Fetching addressable 2.8.7
Installing addressable 2.8.7
Fetching elftools 1.3.1
Installing elftools 1.3.1
Fetching unicode-display_width 3.1.4
Fetching patchelf 1.5.1
Installing unicode-display_width 3.1.4
Installing patchelf 1.5.1
Fetching parser 3.3.7.1
Installing parser 3.3.7.1
Fetching rubocop-ast 1.39.0
Installing rubocop-ast 1.39.0
Fetching rubocop 1.74.0
Installing rubocop 1.74.0
Fetching rubocop-md 2.0.0
Fetching rubocop-performance 1.24.0
Fetching rubocop-rspec 3.5.0
Fetching rubocop-sorbet 0.9.0
Installing rubocop-md 2.0.0
Installing rubocop-performance 1.24.0
Installing rubocop-sorbet 0.9.0
Installing rubocop-rspec 3.5.0
Bundle complete! 42 Gemfile dependencies, 31 gems now installed.
Bundled gems are installed into `../../../Homebrew/vendor/bundle`
==> Downloading https://github.com/algebraic-solving/msolve/archive/refs/tags/v0.7.5.tar.gz
==> Downloading from https://codeload.github.com/algebraic-solving/msolve/tar.gz/refs/tags/v0.7.5
##=O=#   #
Warning: Cannot verify integrity of 'ee5fd12c524d250500b9e8040d12c4e1e2b17f6a3bfb1d41343936293e853d3f--msolve-0.7.5.tar.gz'.
No checksum was provided.
For your reference, the checksum is:
  sha256 "e88368abfd1e1918329ff9444164ca0e304835794fec68d192a63c845ae63128"
Error: uninitialized constant JSON::Ext::ParserConfig
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:32:in `<module:Ext>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:8:in `<module:JSON>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:5:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:586:in `<module:JSON>'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:584:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cask/config.rb:4:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cli/parser.rb:6:in `<top (required)>'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:50:in `<main>'
Error: `brew audit` failed!

What did you expect to happen?

Brew to create a update PR, or show the output of brew style.

Step-by-step reproduction instructions (by running brew commands)

Here is another instance, demonstrating the the error is not specific to one formula. I first clean up the vendor directory and call brew update, everything is normal, then:

$ brew style flint
==> Installing 'bundler' gem
Fetching bundler-2.5.20.gem
Fetching gem metadata from https://rubygems.org/.......
Fetching public_suffix 6.0.1
Fetching ast 2.4.2
Fetching base64 0.2.0
Fetching bindata 2.5.0
Installing base64 0.2.0
Installing ast 2.4.2
Fetching concurrent-ruby 1.3.5
Installing bindata 2.5.0
Installing public_suffix 6.0.1
Fetching json 2.10.2
Installing json 2.10.2 with native extensions
Fetching language_server-protocol 3.17.0.4
Installing concurrent-ruby 1.3.5
Installing language_server-protocol 3.17.0.4
Fetching lint_roller 1.1.0
Installing lint_roller 1.1.0
Fetching parallel 1.26.3
Installing parallel 1.26.3
Fetching racc 1.8.1
Installing racc 1.8.1 with native extensions
Fetching plist 3.7.2
Installing plist 3.7.2
Fetching rainbow 3.1.1
Installing rainbow 3.1.1
Fetching regexp_parser 2.10.0
Installing regexp_parser 2.10.0
Fetching ruby-progressbar 1.13.0
Installing ruby-progressbar 1.13.0
Fetching unicode-emoji 4.0.4
Fetching ruby-macho 4.1.0
Installing ruby-macho 4.1.0
Installing unicode-emoji 4.0.4
Fetching sorbet-runtime 0.5.11945
Installing sorbet-runtime 0.5.11945
Fetching warning 1.5.0
Installing warning 1.5.0
Fetching addressable 2.8.7
Installing addressable 2.8.7
Fetching elftools 1.3.1
Fetching unicode-display_width 3.1.4
Installing elftools 1.3.1
Installing unicode-display_width 3.1.4
Fetching patchelf 1.5.1
Installing patchelf 1.5.1
Fetching parser 3.3.7.1
Installing parser 3.3.7.1
Fetching rubocop-ast 1.39.0
Installing rubocop-ast 1.39.0
Fetching rubocop 1.74.0
Installing rubocop 1.74.0
Fetching rubocop-md 2.0.0
Fetching rubocop-performance 1.24.0
Fetching rubocop-rspec 3.5.0
Fetching rubocop-sorbet 0.9.0
Installing rubocop-md 2.0.0
Installing rubocop-performance 1.24.0
Installing rubocop-sorbet 0.9.0
Installing rubocop-rspec 3.5.0
Bundle complete! 42 Gemfile dependencies, 30 gems now installed.
Bundled gems are installed into `./vendor/bundle`
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:32:in `<module:Ext>': uninitialized constant JSON::Ext::ParserConfig (NameError)
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:8:in `<module:JSON>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:5:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:586:in `<module:JSON>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:584:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter/json_formatter.rb:3:in `<top (required)>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter.rb:19:in `require_relative'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter.rb:19:in `<module:Formatter>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter.rb:5:in `<module:RuboCop>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter.rb:3:in `<top (required)>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop.rb:761:in `require_relative'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop.rb:761:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/rubocop.rb:9:in `block in <main>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/warnings.rb:29:in `ignore'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11945/lib/types/private/methods/call_validation.rb:282:in `bind_call'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11945/lib/types/private/methods/call_validation.rb:282:in `validate_call'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11945/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/rubocop.rb:8:in `<main>'
@MikeMcQuaid
Copy link
Member

Closing as these reproduction instructions don't work and you're personally unblocked here it seems. Please correct me if wrong.

@MikeMcQuaid MikeMcQuaid closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2025
@mahrud
Copy link
Contributor Author

mahrud commented Mar 20, 2025

I'm not sure what you mean by "personally unblocked". I cannot run brew style or brew audit (and therefore any other brew command that depends on these) without running into this error, and once the error shows up, nothing else works (as you can see not even brew doctor or brew config) until I purge the vendors directory.

I would add that this was also reported by two other people in the Discussions, but there was no solution: https://github.com/orgs/Homebrew/discussions/5874

The error is definitely reproducible for me (i.e. even after purging vendors directory). You're correct that the reproduction steps I've given are unlikely to work for you, but I don't know what other factors contribute to this problem. If you have suggestions I'm happy to test and report back.

@MikeMcQuaid MikeMcQuaid reopened this Mar 20, 2025
@MikeMcQuaid
Copy link
Member

@mahrud can you try to uninstall/reinstall Homebrew?

@mahrud
Copy link
Contributor Author

mahrud commented Mar 20, 2025

Yes, but same issue:

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password)...
==> This script will install:
/home/linuxbrew/.linuxbrew/bin/brew
/home/linuxbrew/.linuxbrew/share/doc/homebrew
/home/linuxbrew/.linuxbrew/share/man/man1/brew.1
/home/linuxbrew/.linuxbrew/share/zsh/site-functions/_brew
/home/linuxbrew/.linuxbrew/etc/bash_completion.d/brew
/home/linuxbrew/.linuxbrew/Homebrew
==> The following new directories will be created:
/home/linuxbrew/.linuxbrew/bin
/home/linuxbrew/.linuxbrew/etc
/home/linuxbrew/.linuxbrew/include
/home/linuxbrew/.linuxbrew/lib
/home/linuxbrew/.linuxbrew/sbin
/home/linuxbrew/.linuxbrew/share
/home/linuxbrew/.linuxbrew/var
/home/linuxbrew/.linuxbrew/opt
/home/linuxbrew/.linuxbrew/share/zsh
/home/linuxbrew/.linuxbrew/share/zsh/site-functions
/home/linuxbrew/.linuxbrew/var/homebrew
/home/linuxbrew/.linuxbrew/var/homebrew/linked
/home/linuxbrew/.linuxbrew/Cellar
/home/linuxbrew/.linuxbrew/Caskroom
/home/linuxbrew/.linuxbrew/Frameworks

Press RETURN/ENTER to continue or any other key to abort:
[sudo] password for mahrud:
==> /usr/bin/sudo /bin/mkdir -p /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
==> /usr/bin/sudo /bin/chmod ug=rwx /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
==> /usr/bin/sudo /bin/chmod go-w /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions
==> /usr/bin/sudo /bin/chown mahrud /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
==> /usr/bin/sudo /bin/chgrp mahrud /home/linuxbrew/.linuxbrew/bin /home/linuxbrew/.linuxbrew/etc /home/linuxbrew/.linuxbrew/include /home/linuxbrew/.linuxbrew/lib /home/linuxbrew/.linuxbrew/sbin /home/linuxbrew/.linuxbrew/share /home/linuxbrew/.linuxbrew/var /home/linuxbrew/.linuxbrew/opt /home/linuxbrew/.linuxbrew/share/zsh /home/linuxbrew/.linuxbrew/share/zsh/site-functions /home/linuxbrew/.linuxbrew/var/homebrew /home/linuxbrew/.linuxbrew/var/homebrew/linked /home/linuxbrew/.linuxbrew/Cellar /home/linuxbrew/.linuxbrew/Caskroom /home/linuxbrew/.linuxbrew/Frameworks
==> /usr/bin/sudo /bin/mkdir -p /home/linuxbrew/.linuxbrew/Homebrew
==> /usr/bin/sudo /bin/chown -R mahrud:mahrud /home/linuxbrew/.linuxbrew/Homebrew
==> Downloading and installing Homebrew...
remote: Enumerating objects: 296340, done.
remote: Counting objects: 100% (182/182), done.
remote: Compressing objects: 100% (136/136), done.
remote: Total 296340 (delta 82), reused 90 (delta 46), pack-reused 296158 (from 3)
remote: Enumerating objects: 55, done.
remote: Counting objects: 100% (33/33), done.
remote: Total 55 (delta 33), reused 33 (delta 33), pack-reused 22 (from 1)
==> Updating Homebrew...
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations

==> Next steps:
- Run these commands in your terminal to add Homebrew to your PATH:
    echo >> /home/mahrud/.bashrc
    echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/mahrud/.bashrc
    eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- Install Homebrew's dependencies if you have sudo access:
    sudo dnf group install development-tools
  For more information, see:
    https://docs.brew.sh/Homebrew-on-Linux
- We recommend that you install GCC:
    brew install gcc
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh

mahrud@noether:~$ brew style flint
Warning: style is a developer command, so Homebrew's
developer mode has been automatically turned on.
To turn developer mode off, run:
  brew developer off

==> Installing 'bundler' gem
Fetching bundler-2.5.20.gem
Fetching gem metadata from https://rubygems.org/.......
Fetching public_suffix 6.0.1
Fetching ast 2.4.2
Fetching base64 0.2.0
Fetching bindata 2.5.0
Installing base64 0.2.0
Installing ast 2.4.2
Fetching concurrent-ruby 1.3.5
Installing bindata 2.5.0
Installing public_suffix 6.0.1
Fetching json 2.10.2
Installing json 2.10.2 with native extensions
Fetching language_server-protocol 3.17.0.4
Installing concurrent-ruby 1.3.5
Installing language_server-protocol 3.17.0.4
Fetching lint_roller 1.1.0
Installing lint_roller 1.1.0
Fetching parallel 1.26.3
Installing parallel 1.26.3
Fetching racc 1.8.1
Installing racc 1.8.1 with native extensions
Fetching plist 3.7.2
Installing plist 3.7.2
Fetching rainbow 3.1.1
Installing rainbow 3.1.1
Fetching regexp_parser 2.10.0
Installing regexp_parser 2.10.0
Fetching ruby-progressbar 1.13.0
Installing ruby-progressbar 1.13.0
Fetching unicode-emoji 4.0.4
Fetching ruby-macho 4.1.0
Installing unicode-emoji 4.0.4
Installing ruby-macho 4.1.0
Fetching sorbet-runtime 0.5.11945
Installing sorbet-runtime 0.5.11945
Fetching warning 1.5.0
Installing warning 1.5.0
Fetching addressable 2.8.7
Installing addressable 2.8.7
Fetching elftools 1.3.1
Installing elftools 1.3.1
Fetching unicode-display_width 3.1.4
Fetching patchelf 1.5.1
Installing unicode-display_width 3.1.4
Installing patchelf 1.5.1
Fetching parser 3.3.7.1
Installing parser 3.3.7.1
Fetching rubocop-ast 1.39.0
Installing rubocop-ast 1.39.0
Fetching rubocop 1.74.0
Installing rubocop 1.74.0
Fetching rubocop-md 2.0.0
Fetching rubocop-performance 1.24.0
Fetching rubocop-rspec 3.5.0
Fetching rubocop-sorbet 0.9.0
Installing rubocop-md 2.0.0
Installing rubocop-performance 1.24.0
Installing rubocop-sorbet 0.9.0
Installing rubocop-rspec 3.5.0
Bundle complete! 42 Gemfile dependencies, 30 gems now installed.
Bundled gems are installed into `../linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle`
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:32:in `<module:Ext>': uninitialized constant JSON::Ext::ParserConfig (NameError)
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:8:in `<module:JSON>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:5:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:586:in `<module:JSON>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:584:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter/json_formatter.rb:3:in `<top (required)>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter.rb:19:in `require_relative'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter.rb:19:in `<module:Formatter>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter.rb:5:in `<module:RuboCop>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop/formatter.rb:3:in `<top (required)>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop.rb:761:in `require_relative'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.74.0/lib/rubocop.rb:761:in `<top (required)>'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/usr/share/rubygems/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/rubocop.rb:9:in `block in <main>'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/warnings.rb:29:in `ignore'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11945/lib/types/private/methods/call_validation.rb:282:in `bind_call'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11945/lib/types/private/methods/call_validation.rb:282:in `validate_call'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11945/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
	from /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/rubocop.rb:8:in `<main>'

@MikeMcQuaid
Copy link
Member

Do you have any bundle configuration in e.g. ~/.bundle?

@mahrud
Copy link
Contributor Author

mahrud commented Mar 20, 2025

I had a cache directory, which I cleared off and purged vendor directory, but it didn't help.

@Bo98
Copy link
Member

Bo98 commented Mar 20, 2025

Do you have a parser.so in /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext/? Looks like it's not finding that properly.

@mahrud
Copy link
Contributor Author

mahrud commented Mar 21, 2025

I do not! This is the contents of the json-2.10.2 directory:

mahrud@noether:~/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2$ find
.
./COPYING
./BSDL
./LEGAL
./json.gemspec
./ext
./ext/json
./ext/json/ext
./ext/json/ext/fbuffer
./ext/json/ext/fbuffer/fbuffer.h
./ext/json/ext/generator
./ext/json/ext/generator/extconf.rb
./ext/json/ext/generator/Makefile
./ext/json/ext/generator/generator.c
./ext/json/ext/parser
./ext/json/ext/parser/extconf.rb
./ext/json/ext/parser/parser.c
./ext/json/ext/parser/Makefile
./lib
./lib/json
./lib/json/generic_object.rb
./lib/json/version.rb
./lib/json/common.rb
./lib/json/add
./lib/json/add/date_time.rb
./lib/json/add/bigdecimal.rb
./lib/json/add/struct.rb
./lib/json/add/set.rb
./lib/json/add/symbol.rb
./lib/json/add/range.rb
./lib/json/add/regexp.rb
./lib/json/add/exception.rb
./lib/json/add/ostruct.rb
./lib/json/add/core.rb
./lib/json/add/rational.rb
./lib/json/add/time.rb
./lib/json/add/complex.rb
./lib/json/add/date.rb
./lib/json/ext
./lib/json/ext/generator
./lib/json/ext/generator/state.rb
./lib/json/truffle_ruby
./lib/json/truffle_ruby/generator.rb
./lib/json/ext.rb
./lib/json.rb
./CHANGES.md
./README.md

Thanks for the help!

@Bo98
Copy link
Member

Bo98 commented Mar 21, 2025

Ok this is likely caused by Fedora's configuration of Ruby: https://src.fedoraproject.org/rpms/ruby/blob/rawhide/f/operating_system.rb#_154.

This isn't necessarily going to be easy to workaround:

  • In Ruby 3.4, these is a new option to disable this via gemrc. We might be able to force that on our side.
  • We could probably avoid the problem altogether by forcing the Gemfile.lock to use the versions that ship with Ruby itself and to stop Dependabot updating e.g. json. This seems reasonable and will make the install quicker too, but will require an amount of boilerplate on our side as Bundler doesn't make this overly easy.
  • We should probably also consider preferring Portable Ruby more aggressively over system versions. System versions will still be supported but just not used by default on platforms we build Portable Ruby for.

We'll likely do all of the above I reckon, but it won't be a quick fix (particularly the first two).

However you can fix this in the meantime by setting HOMEBREW_FORCE_VENDOR_RUBY=1. You will need to clear and reinstall the vendor gems after doing so.

@mahrud
Copy link
Contributor Author

mahrud commented Mar 21, 2025

Ah, spot on! The quick workaround works, thank you very much!

@Porkepix
Copy link

For the record, ArchLinux suffer from the same issue for quite some time.

@Bo98
Copy link
Member

Bo98 commented Mar 21, 2025

Don't see where they do their config, but Arch Linux has extra problems anyway where they don't ship the entire standard library together for some reason. Though those type of issues could/should be checked in ruby_check_version_script.rb

@Porkepix
Copy link

Porkepix commented Mar 21, 2025

Don't see where they do their config, but Arch Linux has extra problems anyway where they don't ship the entire standard library together for some reason. Though those type of issues could/should be checked in ruby_check_version_script.rb

Are you talking about the ruby config? https://gitlab.archlinux.org/archlinux/packaging/packages/ruby/-/blob/main/PKGBUILD?ref_type=heads
Taken from https://archlinux.org/packages/extra/x86_64/ruby/ with Source Files > PKGBUILD.
You could also refer to these, all optional deps (see in the link above for where it was taking from, and how to find their respective config/build instructions):
https://archlinux.org/packages/extra/x86_64/ruby-bundled-gems/
https://archlinux.org/packages/extra/x86_64/ruby-default-gems/
https://archlinux.org/packages/extra/x86_64/ruby-stdlib/
https://archlinux.org/packages/extra/any/rubygems/

@SalvatoreT
Copy link

I hit this same issue on my M3 Mac.

❯ brew doctor
Error: uninitialized constant JSON::Ext::ParserConfig
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:32:in `<module:Ext>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:8:in `<module:JSON>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json/ext.rb:5:in `<top (required)>'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:586:in `<module:JSON>'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.10.2/lib/json.rb:584:in `<top (required)>'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/homebrew/Library/Homebrew/cask/config.rb:4:in `<top (required)>'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/homebrew/Library/Homebrew/cli/parser.rb:6:in `<top (required)>'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
<internal:/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
/opt/homebrew/Library/Homebrew/brew.rb:50:in `<main>'

I uninstalled and re-installed Homebrew, and then could get the config.

❯ brew config
HOMEBREW_VERSION: 4.4.25-33-gfa9f8bd
ORIGIN: https://github.com/Homebrew/brew
HEAD: fa9f8bd78142b8cdf30e640dd20efcd2a6caf60a
Last commit: 2 days ago
Branch: master
Core tap HEAD: b5360a3cd07a58aa1de8ffcb025ca7c3dca9b512
Core tap last commit: 36 minutes ago
Core tap JSON: 23 Mar 21:28 UTC
Core cask tap origin: https://github.com/Homebrew/homebrew-cask.git
Core cask tap HEAD: a31bacfcf77bd2b59cea268b550f8a2bbd1402d5
Core cask tap last commit: 2 hours ago
Core cask tap JSON: 23 Mar 21:28 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 12
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: dodeca-core 64-bit arm_lobos
Clang: 16.0.0 build 1600
Git: 2.49.0 => /opt/homebrew/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.3.2-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: 16.2
Rosetta 2: false

@vovanthuong1
Copy link

#19553

@vovanthuong1
Copy link

19553

Copy link

github-actions bot commented May 4, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label May 4, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale No recent activity
Projects
None yet
Development

No branches or pull requests

6 participants