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

Rubygems 3.4.12 `silence_warnings': uninitialized constant Gem::DefaultUserInteraction (NameError) #1485

Open
tadman opened this issue Apr 18, 2023 · 3 comments

Comments

@tadman
Copy link

tadman commented Apr 18, 2023

There might be a compatibility issue with Rubygems where Gem::DefaultUserInteraction is not automatically loaded, as in:

$ tapioca dsl

.../.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/tapioca-0.11.5/lib/tapioca.rb:22:in `silence_warnings': uninitialized constant Gem::DefaultUserInteraction (NameError)

Likely because of this:

require 'rubygems'

Gem::DefaultUserInteraction
# =>  uninitialized constant Gem::DefaultUserInteraction (NameError)

For what it's worth, force-requiring it does make that visible:

require 'rubygems/user_interaction'

Though silence_warnings doesn't do this currently, and doesn't check that it's loaded before exercising the use_ui method.

This is with Rubygems 3.4.12 and Tapioca v0.11.5 on macOS 13.3.1.

@KaanOzkan
Copy link
Contributor

KaanOzkan commented Apr 19, 2023

Yes looks like in since v3.3.4 it's not loaded by default. We can manually load it in tapioca.

However, it's recommended that you use the binstubs tapioca generates instead which resolves the issue as well: bin/tapioca dsl or even bundle exec tapioca dsl.

@tadman
Copy link
Author

tadman commented Apr 20, 2023

The binstub version does work, so that's good, but it's inconvenient that the globally installed one does not.

Should be an easy fix.

@JamieMagee
Copy link

If I understand this thread correctly, the fix is to require 'rubygems/user_interaction' in lib/tapioca.rb. If so, I'll create a small PR to fix this.

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

No branches or pull requests

3 participants