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

Error: uninitialized constant Bignum (NameError) #15

Closed
trevor opened this issue Feb 23, 2023 · 5 comments · Fixed by #16
Closed

Error: uninitialized constant Bignum (NameError) #15

trevor opened this issue Feb 23, 2023 · 5 comments · Fixed by #16

Comments

@trevor
Copy link

trevor commented Feb 23, 2023

Related to: relevance/edn-ruby#39

The edn gem dependency relies on the Ruby Bignum class. This has been deprecated for some time and has now been removed from Ruby 3.2.

Loading edn_turbo now results in an error. Is there any possible workaround?

% ruby --version
ruby 3.2.1 (2023-02-08 revision 31819e82c8) [arm64-darwin22]

irb(main):001:0> require 'edn_turbo'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/edn-1.1.1/lib/edn/core_ext.rb:97:in `<top (required)>': uninitialized constant Bignum (NameError)

Bignum.send(:include, EDN::CoreExt::Bignum)
^^^^^^
	from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
	from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/edn-1.1.1/lib/edn.rb:4:in `<top (required)>'
	from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
	from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/edn_turbo-0.7.4/lib/edn_turbo.rb:25:in `<top (required)>'
	from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:162:in `require'
	from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:162:in `rescue in require'
	from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:152:in `require'
	from (irb):1:in `<main>'
	from /opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/gems/3.2.0/gems/irb-1.6.2/exe/irb:11:in `<top (required)>'
	from /opt/homebrew/opt/ruby/bin/irb:25:in `load'
	from /opt/homebrew/opt/ruby/bin/irb:25:in `<main>'
<internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require': cannot load such file -- edn_turbo (LoadError)
	from <internal:/opt/homebrew/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:88:in `require'
	from (irb):1:in `<main>'
	from /opt/homebrew/Cellar/ruby/3.2.1/lib/ruby/gems/3.2.0/gems/irb-1.6.2/exe/irb:11:in `<top (required)>'
	from /opt/homebrew/opt/ruby/bin/irb:25:in `load'
	from /opt/homebrew/opt/ruby/bin/irb:25:in `<main>'
@edporras
Copy link
Owner

Unfortunately, I'm not sure what can be done on my end. Someone needs to take ownership of edn-ruby as it seems relevance (cognitect) have completely dropped supporting it. I'm not sure how easy that is on the rubygems side, though?

Alternatively, an option might be to inherit edn-ruby into the edn_turbo source and turn it into its own gem? I have no idea how that may break things for people upgrading however. I also don't do much work on Ruby these days but, if several folks seem interested in doing something like this, I'd be happy to help with the migration and release.

@trevor
Copy link
Author

trevor commented Feb 27, 2023

If https://github.com/relevance/edn-ruby can no longer be maintained, then I suppose a fork may be needed and a new Ruby Gem built.

As you suggest inheriting edn-ruby into the edn_turbo source may also be a path forward.

I've sent an email to @russolsen hoping he may be able to weigh in on this.

If the edn-ruby repo can be updated, I'm guessing relevance/edn-ruby#47 may be the fix.

ping @caleb

@trevor
Copy link
Author

trevor commented Mar 9, 2023

A drop-in replacement has been created. The new gem is edn2023.

The only update needed on your part is in edn_turbo.gemspec. Change:

 s.add_runtime_dependency('edn', '~> 1.1')

To:

 s.add_runtime_dependency('edn2023', '~> 1.1')

You may also want to update the "Dependencies" section in README.md.

See:

Thank you for your help!

@edporras
Copy link
Owner

I'm getting a 404 on that repo

@trevor
Copy link
Author

trevor commented Mar 11, 2023

Thanks for catching that. Repo has been made publicly visible.

@edporras edporras linked a pull request Mar 12, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants