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
gem exec rails new
prints "Unresolved or ambiguous specs" warning
#6914
Comments
So I think this might be happening because In summary, yes this gets exhibited via |
More specifically, |
Interesting! That's a much more concise repro. Should I close this issue and replace it with a simpler one that describes the underlying readline/reline problem? |
Hmm, actually this doesn't seem to be uniquely a readline/reline problem. Any gem that declares a runtime dependency but doesn't use it right away will trigger warnings on
|
I think that actually is the expected behavior? |
Thanks. So if this bug affects my executable that is being run via |
Something like this: # Work around an "unresolved or ambiguous specs" warning when CLI is run via `gem exec`
at_exit do
require "reline" if defined?(Readline)
end |
Alternatively, you could use Gem.finish_resolve to force an eager resolution of all unresolved deps. Or you could ignore the warning, up to you.
|
Does this bug need to be fixed in Rails, in Thor, or in the bundled Readline? I feel like we should probably let them know they are triggering this warning and how to fix it. |
I still don't fully understand the nature of this bug, or why Bundler needs to warn about unresolved specs at the end of However, I did some more investigation and found that:
Footnotes |
@segiddins if I modify the
Then Rails does not run Details
|
Actually, I take this back. I can't figure out an easy way to test this change. My edits to the gemspec at |
Ah, I didn't realize that the spec is loaded from a different path than the gem itself. It seems to be loaded from:
If I edit that gemspec and add So it seems like the solution may be for Thor to add |
Describe the problem as clearly as you can
In certain circumstances,
gem exec
will print a warning like this:Did you try upgrading RubyGems?
Yes.
Post steps to reproduce the problem
The simplest way I've found to reproduce the problem is by using
gem exec rails new
with a Rails template that usesask
, a method from Thor that indirectly usesreline
.The following gist simply contains 1 line:
https://gist.github.com/mattbrictson/8f19b250ceb65ddec1c641ce1dc667fd
Invoking
rails new
with that gist yields the following:I can also reproduce the problem in a clean Docker image by first explicitly installing
reline
:Which command did you run?
gem exec
What were you expecting to happen?
I was expecting no warnings.
What actually happened?
Run
gem env
and paste the output belowmacOS
Docker
The text was updated successfully, but these errors were encountered: